Type to search.

Translate SQL into Elasticsearch queries

  • POST also GET /_sql/translate
Auth The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability Generally available since 6.3 This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

Translate an SQL search into a search API request containing Query DSL. It accepts the same request body parameters as the SQL search API, excluding cursor.

Required privileges

Index privileges read

Request body

fetch_size number · default: 1000

The maximum number of rows (or entries) to return in one response.

filter {} Query · default: none

The Elasticsearch query DSL for additional filtering.

query string required

The SQL query to run.

time_zone string · default: Z

The ISO-8601 time zone ID for the search.

Response

application/json
aggregations map string to {} Aggregation
size number
_source union oneOf
One of:
query {} Query
track_total_hits boolean | number