_cat/indices response explanation for replica shards

The _cat/indices endpoint returns primary shard count and replica factor, e.g.

health status index                    uuid                    pri rep docs.count docs.deleted store.size pri.store.size
yellow open   hioqqain.local.dev       Z364S_RLSjiQF6cK_45Vcg   4   1        100           23    233.1kb        233.1kb
yellow open   hioqqain.local.dev       0zCVSdGeSsS-zKBu-fTE8Q   4   1          0            0      1.1kb          1.1kb

But the help says they should be shard count,

pri        | p,shards.primary,shardsPrimary | number of primary shards                                                                                         
rep        | r,shards.replica,shardsReplica | number of replica shards

Is the help wrong in this case?

Hi @sha1 Welcome to the community.

To calculate the total number or shard in an index it is

Total Number of Shared = Number of Primary Shards * (Number of Replicas + 1) #The 1 is the primary shard so there are actually 2 copies of the data.

So for Above

Total Shards for hioqqain.local.dev = 4 Primary Shards * Replicas (1Rep +1Pri) = 8 total Shards

Thats the math

You can see all the shards

GET /_cat/shards/?v

1 Like

Thanks @stephenb

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.