indices.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [[cat-indices]]
  2. == cat indices
  3. The `indices` command provides a cross-section of each index. This
  4. information *spans nodes*.
  5. [source,sh]
  6. --------------------------------------------------
  7. % curl 'localhost:9200/_cat/indices/twi*?v'
  8. health status index pri rep docs.count docs.deleted store.size pri.store.size
  9. green open twitter 5 1 11434 0 64mb 32mb
  10. green open twitter2 2 0 2030 0 5.8mb 5.8mb
  11. --------------------------------------------------
  12. We can tell quickly how many shards make up an index, the number of
  13. docs at the Lucene level, including hidden docs (e.g., from nested types),
  14. deleted docs, primary store size, and total store size (all shards including replicas).
  15. All these exposed metrics come directly from Lucene APIs.
  16. [float]
  17. [[pri-flag]]
  18. === Primaries
  19. The index stats by default will show them for all of an index's
  20. shards, including replicas. A `pri` flag can be supplied to enable
  21. the view of relevant stats in the context of only the primaries.
  22. [float]
  23. [[examples]]
  24. === Examples
  25. Which indices are yellow?
  26. [source,sh]
  27. --------------------------------------------------
  28. % curl localhost:9200/_cat/indices?health=yellow
  29. yellow open wiki 2 1 6401 1115 151.4mb 151.4mb
  30. yellow open twitter 5 1 11434 0 32mb 32mb
  31. --------------------------------------------------
  32. What's my largest index by disk usage not including replicas?
  33. [source,sh]
  34. --------------------------------------------------
  35. % curl 'localhost:9200/_cat/indices?bytes=b' | sort -rnk8
  36. green open wiki 2 0 6401 1115 158843725 158843725
  37. green open twitter 5 1 11434 0 67155614 33577857
  38. green open twitter2 2 0 2030 0 6125085 6125085
  39. --------------------------------------------------
  40. How many merge operations have the shards for the `wiki` completed?
  41. [source,sh]
  42. --------------------------------------------------
  43. % curl 'localhost:9200/_cat/indices/wiki?pri&v&h=health,index,prirep,docs.count,mt'
  44. health index docs.count mt pri.mt
  45. green wiki 9646 16 16
  46. --------------------------------------------------
  47. How much memory is used per index?
  48. [source,sh]
  49. --------------------------------------------------
  50. % curl 'localhost:9200/_cat/indices?v&h=i,tm'
  51. i tm
  52. wiki 8.1gb
  53. test 30.5kb
  54. user 1.9mb
  55. --------------------------------------------------