indices-exists.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [[indices-exists]]
  2. === Index exists API
  3. ++++
  4. <titleabbrev>Index exists</titleabbrev>
  5. ++++
  6. Checks if an index exists.
  7. The returned HTTP status code indicates if the index exists or not.
  8. A `404` means it does not exist, and `200` means it does.
  9. [source,console]
  10. --------------------------------------------------
  11. HEAD /twitter
  12. --------------------------------------------------
  13. // TEST[setup:twitter]
  14. [[indices-exists-api-request]]
  15. ==== {api-request-title}
  16. `HEAD /<index>`
  17. [[indices-exists-api-path-params]]
  18. ==== {api-path-parms-title}
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
  20. +
  21. IMPORTANT: This parameter does not distinguish between an index name and <<indices-aliases,alias>>,
  22. i.e. status code `200` is also returned if an alias exists with that name.
  23. [[indices-exists-api-query-params]]
  24. ==== {api-query-parms-title}
  25. include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]
  26. include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  27. +
  28. Defaults to `open`.
  29. include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]
  30. include::{docdir}/rest-api/common-parms.asciidoc[tag=include-defaults]
  31. include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
  32. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  33. [[indices-exists-api-response-codes]]
  34. ==== {api-response-codes-title}
  35. `200`::
  36. Indicates all specified indices or index aliases exist.
  37. `404`::
  38. Indicates one or more specified indices or index aliases **do not** exist.