indices.asciidoc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. [[cat-indices]]
  2. === cat indices
  3. Returns high-level information about indices in a cluster.
  4. [[cat-indices-api-request]]
  5. ==== {api-request-title}
  6. `GET /_cat/indices/{index}`
  7. [[cat-indices-api-desc]]
  8. ==== {api-description-title}
  9. Use the cat indices API to get the following information for each index in a
  10. cluster:
  11. * Shard count
  12. * Document count
  13. * Deleted document count
  14. * Primary store size
  15. * Total store size of all shards, including shard replicas
  16. These metrics are retrieved directly from
  17. https://lucene.apache.org/core/[Lucene], which {es} uses internally to power
  18. indexing and search. As a result, all document counts include hidden
  19. <<nested,nested>> documents.
  20. To get an accurate count of {es} documents, use the <<cat-count,cat count>> or
  21. <<search-count,count>> APIs.
  22. [[cat-indices-api-path-params]]
  23. ==== {api-path-parms-title}
  24. include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
  25. [[cat-indices-api-query-params]]
  26. ==== {api-query-parms-title}
  27. include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes]
  28. include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
  29. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
  30. `health`::
  31. +
  32. --
  33. (Optional, string) Health status used to limit returned indices. Valid values
  34. are:
  35. * `green`
  36. * `yellow`
  37. * `red`
  38. By default, the response includes indices of any health status.
  39. --
  40. include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
  41. include::{docdir}/rest-api/common-parms.asciidoc[tag=include-unloaded-segments]
  42. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  43. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  44. [[pri-flag]]
  45. `pri` (primary shards)::
  46. (Optional, boolean) If `true`, the response only includes information from
  47. primary shards. Defaults to `false`.
  48. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
  49. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
  50. [[cat-indices-api-example]]
  51. ==== {api-examples-title}
  52. [[examples]]
  53. [source,js]
  54. --------------------------------------------------
  55. GET /_cat/indices/twi*?v&s=index
  56. --------------------------------------------------
  57. // CONSOLE
  58. // TEST[setup:huge_twitter]
  59. // TEST[s/^/PUT twitter2\n{"settings": {"number_of_replicas": 0}}\n/]
  60. The API returns the following response:
  61. [source,txt]
  62. --------------------------------------------------
  63. health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
  64. yellow open twitter u8FNjxh8Rfy_awN11oDKYQ 1 1 1200 0 88.1kb 88.1kb
  65. green open twitter2 nYFWZEO7TUiOjLQXBaYJpA 1 0 0 0 260b 260b
  66. --------------------------------------------------
  67. // TESTRESPONSE[s/\d+(\.\d+)?[tgmk]?b/\\d+(\\.\\d+)?[tgmk]?b/]
  68. // TESTRESPONSE[s/u8FNjxh8Rfy_awN11oDKYQ|nYFWZEO7TUiOjLQXBaYJpA/.+/ non_json]