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