Translate SQL into Elasticsearch queries Added in 6.3.0
Translate an SQL search into a search API request containing Query DSL.
Body Required
-
fetch_size number
The maximum number of rows (or entries) to return in one response.
-
filter object
Additional properties are allowed.
-
SQL query to run.
-
time_zone string
GET
/_sql/translate
curl \
-X GET http://api.example.com/_sql/translate \
-H "Content-Type: application/json" \
-d '{"fetch_size":42.0,"filter":{},"query":"string","time_zone":"string"}'
Request examples
{
"fetch_size": 42.0,
"filter": {},
"query": "string",
"time_zone": "string"
}
Response examples (200)
{
"aggregations": {},
"size": 42.0,
"": "string",
"fields": [
{
"field": "string",
"format": "string",
"include_unmapped": true
}
],
"query": {}
}