fleet-search.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [role="xpack"]
  2. [[fleet-search]]
  3. === Fleet search API
  4. ++++
  5. <titleabbrev>Fleet search</titleabbrev>
  6. ++++
  7. The purpose of the fleet search api is to provide a search api where the search
  8. will only be executed after provided checkpoint has been processed and is visible
  9. for searches inside of Elasticsearch.
  10. NOTE: The fleet search API is designed for indirect use through fleet server. Direct use is
  11. not supported. Elastic reserves the right to change or remove this feature in future releases
  12. without prior notice.
  13. [discrete]
  14. [[wait-for-checkpoint-functionality]]
  15. == Wait for checkpoint functionality
  16. The fleet search API supports the optional parameter `wait_for_checkpoints`. This parameter
  17. is a list of sequence number checkpoints. When this parameter is present, the search will
  18. only be executed on local shards after the all operations up to and including the provided
  19. sequence number checkpoint are visible for search. Indexed operations become visible after a
  20. refresh. The checkpoints are indexed by shard.
  21. If a timeout occurs before the the checkpoint has been refreshed into Elasticsearch,
  22. the search request will timeout.
  23. The fleet search API only supports searches against a single target. If an index alias
  24. is supplied as the search target, it must resolve to a single concrete index.
  25. [discrete]
  26. [[fleet-search-partial-responses]]
  27. == Allow partial results
  28. By default, the Elasticsearch search api will allow <<search-partial-responses,partial search results>>.
  29. With this fleet API, it is common to configure this to be `false` or to check in the response
  30. to ensure each shard search was successful. If these precautions are not taken, it is
  31. possible for search results to be successfully returned even if one or more shards
  32. timed out.
  33. [[fleet-search-api-request]]
  34. ==== {api-request-title}
  35. `GET /<target>/_fleet/_search`
  36. [[fleet-search-api-path-params]]
  37. ==== {api-path-parms-title}
  38. `<target>`::
  39. (Required, string)
  40. A single target to search. If the target is an index alias, it must resolve to a single index.
  41. [role="child_attributes"]
  42. [[fleet-search-api-query-parms]]
  43. ==== {api-query-parms-title}
  44. `wait_for_checkpoints`::
  45. (Optional, list) A comma separated list of checkpoints. When configured, the search API will
  46. only be executed on a shard after the relevant checkpoint has become visible for search.
  47. Defaults to an empty list which will cause Elasticsearch to immediately execute the search.
  48. `allow_partial_search_results`::
  49. (Optional, Boolean)
  50. If `true`, returns partial results if there are shard request timeouts or
  51. <<shard-failures,shard failures>>. If `false`, returns an error with
  52. no partial results. Defaults to the configured cluster setting `search.default_allow_partial_results` which
  53. is `true` by default.