Translates SQL into Elasticsearch queries Added in 6.3.0

POST /_sql/translate
application/json

Body Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • size number
    • _source boolean | object

      Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

      One of:
    • fields array[object]
      Hide fields attributes Show fields attributes object
      • field string Required

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • format string

        Format in which the values are returned.

    • query object

      Additional properties are allowed.

    • sort string | object | array[string | object]

      One of:

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      One of:

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

POST /_sql/translate
curl \
 -X POST 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": {}
}