Get async SQL search API
Returns results for an async SQL search or a stored synchronous SQL search.
resp = client.sql.get_async(
id="FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
format="json",
)
print(resp) response = client.sql.get_async( id: 'FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=', format: 'json' ) puts response
const response = await client.sql.getAsync({
id: "FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=",
format: "json",
});
console.log(response); GET _sql/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=?format=json
Request
GET _sql/async/<search_id>
Prerequisites
- If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API.
Limitations
See SQL Limitations.
Path parameters
-
<search_id> - (Required, string) Identifier for the search.
Query parameters
-
delimiter - (Optional, string) Separator for CSV results. Defaults to
,. The API only supports this parameter for CSV responses. -
format - (Required, string) 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. For valid values, see Response Data Formats. -
keep_alive - (Optional, time value) Retention period for the search and its results. Defaults to the
keep_aliveperiod for the original SQL search. -
wait_for_completion_timeout - (Optional, time value) Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results.
Response body
The get async SQL search API returns the same response body as the SQL search API.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/get-async-sql-search-api.html