Get async SQL search results
- GET /_sql/async/{id}
Get the current status and available results for an async SQL search or stored synchronous SQL search.
If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API.
Path Parameters
-
idstring Idrequired -
The identifier for the search.
Query Parameters
-
delimiterstring · default: , The separator for CSV results. The API supports this parameter only for CSV responses.
-
formatstring The format for the response. You must specify a format using this parameter or the
AcceptHTTP header. If you specify both, the API uses this parameter.-
keep_alivestring Duration · default: 5d The retention period for the search and its results. It defaults to the
keep_aliveperiod for the original SQL search.-
wait_for_completion_timeoutstring Duration The period to wait for complete results. It defaults to no timeout, meaning the request waits for complete search results.
Response
-
idstring Idrequired -
Identifier for the search. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in the
Async-IDHTTP header. -
is_runningbooleanrequired -
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-partialHTTP header. -
is_partialbooleanrequired -
If
true, the response does not contain complete search results. Ifis_partialistrueandis_runningistrue, the search is still running. Ifis_partialistruebutis_runningisfalse, 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-partialHTTP header. -
columnsColumn -
Column headings for the search results. Each object is a column.
-
cursorstring -
The cursor for the next set of paginated results. For CSV, TSV, and TXT responses, this value is returned in the
CursorHTTP header. -
rowsRowrequired -
The values for the search results.