Elasticsearch-SQL is a SQL-like syntax for Elasticsearch introduced in version 6.3 of the Elastic Stack via the x-pack plugin.
Elasticsearch-SQL was introduced in x-pack 6.3. It provides a SQL-like syntax for developers familiar with SQL concepts and is ultimately translated to a Elasticsearch DSL query. The syntax is targeted at new users and data consumers who do not want the complexity or need the features of the full DSL.
Resources
An Introduction to Elasticsearch SQL with Practical Examples - Part 1
An Introduction to Elasticsearch SQL with Practical Examples - Part 2
Example Query
POST /_xpack/sql?format=txt
{
"query": "SELECT FlightNum FROM flights LIMIT 10"
}
Translates to this traditional DSL query:
{
"size": 10,
"_source": {
"includes": [
"FlightNum"
],
"excludes": []
},
"sort": [
{
"_doc": {
"order": "asc"
}
}
]
}
And returns the following response:
FlightNum
---------------
X98CCZO
9HY9SWR
XEJ78I2
P0WMFH7
UFK2WIZ
EAYQW69
1IRBW25
JQ2XXQ5
7TTZM4I
EVARI8I