indices.asciidoc 2.8 KB

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