indices-exists.asciidoc 1.5 KB

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