open-close.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. [[indices-open-close]]
  2. == Open / Close Index API
  3. The open and close index APIs allow to close an index, and later on
  4. opening it. A closed index has almost no overhead on the cluster (except
  5. for maintaining its metadata), and is blocked for read/write operations.
  6. A closed index can be opened which will then go through the normal
  7. recovery process.
  8. The REST endpoint is `/{index}/_close` and `/{index}/_open`. For
  9. example:
  10. [source,js]
  11. --------------------------------------------------
  12. POST /my_index/_close
  13. POST /my_index/_open
  14. --------------------------------------------------
  15. // CONSOLE
  16. // TEST[s/^/PUT my_index\n/]
  17. It is possible to open and close multiple indices. An error will be thrown
  18. if the request explicitly refers to a missing index. This behaviour can be
  19. disabled using the `ignore_unavailable=true` parameter.
  20. All indices can be opened or closed at once using `_all` as the index name
  21. or specifying patterns that identify them all (e.g. `*`).
  22. Identifying indices via wildcards or `_all` can be disabled by setting the
  23. `action.destructive_requires_name` flag in the config file to `true`.
  24. This setting can also be changed via the cluster update settings api.
  25. Closed indices consume a significant amount of disk-space which can cause problems in managed environments. Closing indices can be disabled via the cluster settings
  26. API by setting `cluster.indices.close.enable` to `false`. The default is `true`.
  27. [float]
  28. === Wait For Active Shards
  29. Because opening an index allocates its shards, the
  30. <<create-index-wait-for-active-shards,`wait_for_active_shards`>> setting on
  31. index creation applies to the index opening action as well.