1
0

refresh.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --
  2. :api: refresh
  3. :request: RefreshRequest
  4. :response: RefreshResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Refresh API
  8. [id="{upid}-{api}-request"]
  9. ==== Refresh Request
  10. A +{request}+ can be applied to one or more indices, or even on `_all` the indices:
  11. ["source","java",subs="attributes,callouts,macros"]
  12. --------------------------------------------------
  13. include-tagged::{doc-tests-file}[{api}-request]
  14. --------------------------------------------------
  15. <1> Refresh one index
  16. <2> Refresh multiple indices
  17. <3> Refresh all the indices
  18. ==== Optional arguments
  19. ["source","java",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{doc-tests-file}[{api}-request-indicesOptions]
  22. --------------------------------------------------
  23. <1> Setting `IndicesOptions` controls how unavailable indices are resolved and
  24. how wildcard expressions are expanded
  25. include::../execution.asciidoc[]
  26. [id="{upid}-{api}-response"]
  27. ==== Refresh Response
  28. The returned +{response}+ allows to retrieve information about the
  29. executed operation as follows:
  30. ["source","java",subs="attributes,callouts,macros"]
  31. --------------------------------------------------
  32. include-tagged::{doc-tests-file}[{api}-response]
  33. --------------------------------------------------
  34. <1> Total number of shards hit by the refresh request
  35. <2> Number of shards where the refresh has succeeded
  36. <3> Number of shards where the refresh has failed
  37. <4> A list of failures if the operation failed on one or more shards
  38. By default, if the indices were not found, an `ElasticsearchException` will be thrown:
  39. ["source","java",subs="attributes,callouts,macros"]
  40. --------------------------------------------------
  41. include-tagged::{doc-tests-file}[{api}-notfound]
  42. --------------------------------------------------
  43. <1> Do something if the indices to be refreshed were not found