clear-cache.asciidoc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[searchable-snapshots-api-clear-cache]]
  4. === Clear cache API
  5. ++++
  6. <titleabbrev>Clear cache</titleabbrev>
  7. ++++
  8. experimental[]
  9. Clear the cache of searchable snapshots.
  10. [[searchable-snapshots-api-clear-cache-request]]
  11. ==== {api-request-title}
  12. `POST /_searchable_snapshots/cache/clear`
  13. `POST /<index>/_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
  17. `manage` cluster privilege and the `manage` index privilege
  18. for any included indices to use this API.
  19. For more information, see <<security-privileges>>.
  20. [[searchable-snapshots-api-clear-cache-desc]]
  21. ==== {api-description-title}
  22. [[searchable-snapshots-api-clear-cache-path-params]]
  23. ==== {api-path-parms-title}
  24. `<index>`::
  25. (Optional, string)
  26. A comma-separated list of index names for which the
  27. searchable snapshots cache must be cleared.
  28. [[searchable-snapshots-api-clear-cache-example]]
  29. ==== {api-examples-title}
  30. ////
  31. [source,console]
  32. -----------------------------------
  33. PUT /docs
  34. {
  35. "settings" : {
  36. "index.number_of_shards" : 1,
  37. "index.number_of_replicas" : 0
  38. }
  39. }
  40. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  41. {
  42. "include_global_state": false,
  43. "indices": "docs"
  44. }
  45. DELETE /docs
  46. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  47. {
  48. "index": "docs"
  49. }
  50. -----------------------------------
  51. // TEST[setup:setup-repository]
  52. ////
  53. Clears the cache of the index `docs`:
  54. [source,console]
  55. --------------------------------------------------
  56. POST /docs/_searchable_snapshots/cache/clear
  57. --------------------------------------------------
  58. // TEST[continued]