clear-cache.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [role="xpack"]
  2. [[searchable-snapshots-api-clear-cache]]
  3. === Clear cache API
  4. ++++
  5. <titleabbrev>Clear cache</titleabbrev>
  6. ++++
  7. experimental::[]
  8. Clears indices and data streams from the shared cache for
  9. <<partially-mounted,partially mounted indices>>.
  10. [[searchable-snapshots-api-clear-cache-request]]
  11. ==== {api-request-title}
  12. `POST /_searchable_snapshots/cache/clear`
  13. `POST /<target>/_searchable_snapshots/cache/clear`
  14. [[searchable-snapshots-api-clear-cache-prereqs]]
  15. ==== {api-prereq-title}
  16. If the {es} {security-features} are enabled, you must have the `manage`
  17. <<privileges-list-cluster,cluster privilege>> to use this API. You must also
  18. have the `manage` <<privileges-list-indices,index privileges>> for the target
  19. data stream, index, or alias.
  20. [[searchable-snapshots-api-clear-cache-path-params]]
  21. ==== {api-path-parms-title}
  22. `<target>`::
  23. (Optional, string)
  24. Comma-separated list of data streams, indices, and aliases to clear from the
  25. cache. Supports wildcards (`*`). To clear the entire cache, omit this parameter.
  26. [[searchable-snapshots-api-clear-cache-example]]
  27. ==== {api-examples-title}
  28. ////
  29. [source,console]
  30. -----------------------------------
  31. PUT /docs
  32. {
  33. "settings" : {
  34. "index.number_of_shards" : 1,
  35. "index.number_of_replicas" : 0
  36. }
  37. }
  38. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  39. {
  40. "include_global_state": false,
  41. "indices": "docs"
  42. }
  43. DELETE /docs
  44. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  45. {
  46. "index": "docs",
  47. "renamed_index": "my-index"
  48. }
  49. -----------------------------------
  50. // TEST[setup:setup-repository]
  51. ////
  52. Clears the cache of the index `my-index`:
  53. [source,console]
  54. --------------------------------------------------
  55. POST /my-index/_searchable_snapshots/cache/clear
  56. --------------------------------------------------
  57. // TEST[continued]