summaryrefslogtreecommitdiff
path: root/docs/reference/cat/indices.asciidoc
blob: 0cd202fd32146f7c11f6e62f907c31e265049b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[[cat-indices]]
== Indices

The `indices` command provides a cross-section of each index.  This
information *spans nodes*.

[source,shell]
--------------------------------------------------
% curl 'localhost:9200/_cat/indices/twi*?v'
health index    pri rep docs.count docs.deleted store.size pri.store.size
green  twitter    5   1      11434            0       64mb           32mb
green  twitter2   2   0       2030            0      5.8mb          5.8mb
--------------------------------------------------

We can tell quickly how many shards make up an index, the number of
docs, deleted docs, primary store size, and total store size (all
shards including replicas).

[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.

[float]
[[examples]]
=== Examples

Which indices are yellow?

[source,shell]
--------------------------------------------------
% curl localhost:9200/_cat/indices | grep ^yell
yellow wiki     2 1  6401 1115 151.4mb 151.4mb
yellow twitter  5 1 11434    0    32mb    32mb
--------------------------------------------------

What's my largest index by disk usage not including replicas?

[source,shell]
--------------------------------------------------
% curl 'localhost:9200/_cat/indices?bytes=b' | sort -rnk7
green wiki     2 0  6401 1115 158843725 158843725
green twitter  5 1 11434    0  67155614  33577857
green twitter2 2 0  2030    0   6125085   6125085
--------------------------------------------------

How many merge operations have the shards for the `wiki` completed?

[source,shell]
--------------------------------------------------
% 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
--------------------------------------------------