freeze.asciidoc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[freeze-index-api]]
  4. === Freeze index API
  5. ++++
  6. <titleabbrev>Freeze index</titleabbrev>
  7. ++++
  8. // tag::freeze-api-dep[]
  9. deprecated::[7.14, Frozen indices are no longer useful due to https://www.elastic.co/blog/significantly-decrease-your-elasticsearch-heap-memory-usage[recent improvements in heap memory usage].]
  10. // end::freeze-api-dep[]
  11. Freezes an index.
  12. [[freeze-index-api-request]]
  13. ==== {api-request-title}
  14. `POST /<index>/_freeze`
  15. [[freeze-index-api-prereqs]]
  16. ==== {api-prereq-title}
  17. * If the {es} {security-features} are enabled, you must have the `manage`
  18. <<privileges-list-indices,index privilege>> for the target index or index alias.
  19. [[freeze-index-api-desc]]
  20. ==== {api-description-title}
  21. A frozen index has almost no overhead on the cluster (except for maintaining its
  22. metadata in memory) and is read-only. Read-only indices are blocked for write
  23. operations, such as <<indexing,docs-index_>> or <<indices-forcemerge,force
  24. merges>>. See <<unfreeze-index-api>>.
  25. The current write index on a data stream cannot be frozen. In order to freeze
  26. the current write index, the data stream must first be
  27. <<data-streams-rollover,rolled over>> so that a new write index is created
  28. and then the previous write index can be frozen.
  29. IMPORTANT: Freezing an index will close the index and reopen it within the same
  30. API call. This causes primaries to not be allocated for a short amount of time
  31. and causes the cluster to go red until the primaries are allocated again. This
  32. limitation might be removed in the future.
  33. [[freeze-index-api-path-parms]]
  34. ==== {api-path-parms-title}
  35. `<index>`::
  36. (Required, string) Identifier for the index.
  37. [[freeze-index-api-examples]]
  38. ==== {api-examples-title}
  39. The following example freezes and unfreezes an index:
  40. [source,console]
  41. --------------------------------------------------
  42. POST /my-index-000001/_freeze
  43. POST /my-index-000001/_unfreeze
  44. --------------------------------------------------
  45. // TEST[skip:unable to ignore deprecation warning]
  46. // TEST[s/^/PUT my-index-000001\n/]