Get async ES|QL query results
- GET /_query/async/{id}
Get the current status and available results or stored results for an ES|QL asynchronous query. If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API.
- Index privileges:
read
Path Parameters
-
idstring Idrequired -
The unique identifier of the query. A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. A query ID is also provided when the request was submitted with the
keep_on_completionparameter set totrue.
Query Parameters
-
drop_null_columnsboolean · default: false Indicates whether columns that are entirely
nullwill be removed from thecolumnsandvaluesportion of the results. Iftrue, the response will include an extra section under the nameall_columnswhich has the name of all the columns.-
formatEsqlFormat A short version of the Accept header, for example
jsonoryaml.-
Values:
csvjsontsvtxtyamlcborsmilearrow -
keep_alivestring Duration The period for which the query and its results are stored in the cluster. When this period expires, the query and its results are deleted, even if the query is still ongoing.
-
wait_for_completion_timeoutstring Duration The period to wait for the request to finish. By default, the request waits for complete query results. If the request completes during the period specified in this parameter, complete query results are returned. Otherwise, the response returns an
is_runningvalue oftrueand no results.
Response
-
tookDurationValueUnitMillis -
is_partialboolean -
all_columnsEsqlColumnInfo -
valuesFieldValuerequired -
_clustersEsqlClusterInfo -
Cross-cluster search information. Present if
include_ccs_metadatawastruein the request and a cross-cluster search was performed. -
totalnumberrequired -
successfulnumberrequired -
runningnumberrequired -
skippednumberrequired -
partialnumberrequired -
failednumberrequired -
detailsmap string to EsqlClusterDetailsrequired -
<string>EsqlClusterDetails -
statusEsqlClusterStatusrequired -
Values:
runningsuccessfulpartialskippedfailed -
indicesstringrequired -
tookDurationValueUnitMillis -
_shardsEsqlShardInfo -
totalnumberrequired -
successfulnumber -
skippednumber -
failednumber -
failuresEsqlShardFailure -
shardnumberrequired -
indexIndexName | stringrequired nullable -
nodestring -
reasonErrorCauserequired -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause -
profileobject -
Profiling information. Present if
profilewastruein the request. The contents of this field are currently unstable. -
idstring -
The ID of the async query, to be used in subsequent requests to check the status or retrieve results.
Also available in the
X-Elasticsearch-Async-IdHTTP header. -
is_runningbooleanrequired -
Indicates whether the async query is still running or has completed.
Also available in the
X-Elasticsearch-Async-Is-RunningHTTP header.