SQL translate APIedit

Translates an SQL search into a search API request containing Query DSL. See SQL Translate API.

POST _sql/translate
{
  "query": "SELECT * FROM library ORDER BY page_count DESC",
  "fetch_size": 10
}

Requestedit

GET _sql/translate

POST _sql/translate

Prerequisitesedit

  • If the Elasticsearch security features are enabled, you must have the read index privilege for the data stream, index, or alias you search.

Limitationsedit

See SQL Limitations.

Request bodyedit

The SQL translate API accepts the same request body parameters as the SQL search API, excluding cursor.

Response bodyedit

The SQL translate API returns the same response body as the search API.