delete-index.asciidoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. [[indices-delete-index]]
  2. === Delete index API
  3. ++++
  4. <titleabbrev>Delete index</titleabbrev>
  5. ++++
  6. Deletes one or more indices.
  7. [source,console]
  8. ----
  9. DELETE /my-index-000001
  10. ----
  11. // TEST[setup:my_index]
  12. [[delete-index-api-request]]
  13. ==== {api-request-title}
  14. `DELETE /<index>`
  15. [[delete-index-api-prereqs]]
  16. ==== {api-prereq-title}
  17. * If the {es} {security-features} are enabled, you must have the `delete_index`
  18. or `manage` <<privileges-list-indices,index privilege>> for the target index.
  19. [[delete-index-api-desc]]
  20. ==== {api-description-title}
  21. Deleting an index deletes its documents, shards, and metadata. It does not
  22. delete related {kib} components, such as {data-sources}, visualizations, or
  23. dashboards.
  24. You cannot delete the current write index of a data stream. To delete the
  25. index, you must <<data-streams-rollover,roll over>> the data stream so a new
  26. write index is created. You can then use the delete index API to delete the
  27. previous write index.
  28. [[delete-index-api-path-params]]
  29. ==== {api-path-parms-title}
  30. `<index>`::
  31. (Required, string) Comma-separated list of indices to delete. You cannot specify
  32. <<aliases,index aliases>>.
  33. +
  34. By default, this parameter does not support wildcards (`*`) or `_all`. To use
  35. wildcards or `_all`, set the
  36. <<action-destructive-requires-name,`action.destructive_requires_name`>> cluster
  37. setting to `false`.
  38. [[delete-index-api-query-params]]
  39. ==== {api-query-parms-title}
  40. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  41. +
  42. Defaults to `true`.
  43. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  44. +
  45. Defaults to `open,closed`.
  46. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  47. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]