get-async-sql-search-api.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[get-async-sql-search-api]]
  4. === Get async SQL search API
  5. ++++
  6. <titleabbrev>Get async SQL search</titleabbrev>
  7. ++++
  8. Returns results for an <<sql-async,async SQL search>> or a
  9. <<sql-store-searches,stored synchronous SQL search>>.
  10. [source,console]
  11. ----
  12. GET _sql/async/FmdMX2pIang3UWhLRU5QS0lqdlppYncaMUpYQ05oSkpTc3kwZ21EdC1tbFJXQToxOTI=?format=json
  13. ----
  14. // TEST[skip: no access to search ID]
  15. [[get-async-sql-search-api-request]]
  16. ==== {api-request-title}
  17. `GET _sql/async/<search_id>`
  18. [[get-async-sql-search-api-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, only the user who first submitted
  21. the SQL search can retrieve the search using this API.
  22. [[get-async-sql-search-api-limitations]]
  23. ===== Limitations
  24. See <<sql-limitations>>.
  25. [[get-async-sql-search-api-path-params]]
  26. ==== {api-path-parms-title}
  27. `<search_id>`::
  28. (Required, string) Identifier for the search.
  29. [[get-async-sql-search-api-query-params]]
  30. ==== {api-query-parms-title}
  31. `delimiter`::
  32. (Optional, string) Separator for CSV results. Defaults to `,`. The API only
  33. supports this parameter for CSV responses.
  34. `format`::
  35. (Required, string) Format for the response. You must specify a format using this
  36. parameter or the `Accept` HTTP header. If you specify both, the API uses this
  37. parameter. For valid values, see <<sql-rest-format>>.
  38. `keep_alive`::
  39. (Optional, <<time-units,time value>>) Retention period for the search and its
  40. results. Defaults to the `keep_alive` period for the original SQL search.
  41. `wait_for_completion_timeout`::
  42. (Optional, <<time-units,time value>>) Period to wait for complete results.
  43. Defaults to no timeout, meaning the request waits for complete search results.
  44. [[get-async-sql-search-api-response-body]]
  45. ==== {api-response-body-title}
  46. The get async SQL search API returns the same response body as the SQL search
  47. API.