Skip to content

Commit fb356dd

Browse files
Add docs for async stop command (#2181)
Co-authored-by: Liam Thompson <[email protected]>
1 parent 7f20b02 commit fb356dd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

explore-analyze/query-filter/languages/esql-rest.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,24 @@ If the response’s `is_running` value is `false`, the query has finished and th
299299
}
300300
```
301301

302+
To stop a running async query and return the results computed so far, use the [async stop API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-stop) with the query ID.
303+
304+
```console
305+
POST /_query/async/FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=/stop
306+
```
307+
The query will be stopped and the response will contain the results computed so far. The response format is the same as the `get` API.
308+
309+
```console-result
310+
{
311+
"is_running": false,
312+
"took": 48,
313+
"is_partial": true,
314+
"columns": ...
315+
}
316+
```
317+
This API can be used to retrieve results even if the query has already completed, as long as it's within the `keep_alive` window.
318+
The `is_partial` field indicates result completeness. A value of `true` means the results are potentially incomplete.
319+
302320
Use the [{{esql}} async query delete API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-delete) to delete an async query before the `keep_alive` period ends. If the query is still running, {{es}} cancels it.
303321

304322
```console

0 commit comments

Comments
 (0)