Get SQL search results | Elasticsearch API documentation (original) (raw)
Dismiss highlight Show more
Query parameters
- The format for the response. You can also specify a format using the
Accept
HTTP header. If you specify both this parameter and theAccept
HTTP header, this parameter takes precedence.
Values arecsv
,json
,tsv
,txt
,yaml
,cbor
, orsmile
.
application/json
Body Required
- If
true
, the response has partial results when there are shard request timeouts or shard failures. Iffalse
, the API returns an error with no partial results. - The default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.
- If
true
, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results. The API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.
External documentation - The cursor used to retrieve a set of paginated results. If you specify a cursor, the API only uses the
columnar
andtime_zone
request body parameters. It ignores other request body parameters. - The maximum number of rows (or entries) to return in one response.
- If
false
, the API returns an exception when encountering multiple values for a field. Iftrue
, the API is lenient and returns the first value from the array with no guarantee of consistent results. - An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.
External documentation - If
true
, the search can run on frozen indices. - A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. - If
true
, Elasticsearch stores synchronous searches if you also specify thewait_for_completion_timeout
parameter. Iffalse
, Elasticsearch only stores async searches that don't finish before thewait_for_completion_timeout
. - A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. - The values for parameters in the query.
Hide params attribute Show params attribute object- *
object Additional properties
- *
- The SQL query to run.
External documentation - A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. - Hide runtime_mappings attribute Show runtime_mappings attribute object
- *
object Additional properties
Hide * attributes Show * attributes object
* For typecomposite
Hide fields attribute Show fields attribute object
* *
object Additional properties
Hide * attribute Show * attribute object
* Values areboolean
,composite
,date
,double
,geo_point
,geo_shape
,ip
,keyword
,long
, orlookup
.
* For typelookup
Hide fetch_fields attributes Show fetch_fields attributes object
* Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
* A custom format fordate
type runtime fields.
* Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
* Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
* Hide script attributes Show script attributes object
* Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.
Hide params attribute Show params attribute object
* *
object Additional properties
* #### lang string
Values arepainless
,expression
,mustache
, orjava
.
* Hide options attribute Show options attribute object
* *
string Additional properties
* Values areboolean
,composite
,date
,double
,geo_point
,geo_shape
,ip
,keyword
,long
, orlookup
.
- *
- A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
Responses
- 200 application/json
Hide response attributes Show response attributes object- Column headings for the search results. Each object is a column.
Hide columns attributes Show columns attributes object - The cursor for the next set of paginated results. For CSV, TSV, and TXT responses, this value is returned in the
Cursor
HTTP header. - If
true
, the search is still running. Iffalse
, the search has finished. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in theAsync-partial
HTTP header. - If
true
, the response does not contain complete search results. Ifis_partial
istrue
andis_running
istrue
, the search is still running. Ifis_partial
istrue
butis_running
isfalse
, the results are partial due to a failure or timeout. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in theAsync-partial
HTTP header. - rows
array[array] Required
The values for the search results.
- Column headings for the search results. Each object is a column.