# Clarification needed on stats

**URL:** https://discuss.elastic.co/t/clarification-needed-on-stats/9708
**Category:** Elasticsearch
**Created:** [November 14, 2012, 1:01am UTC](https://discuss.elastic.co/t/clarification-needed-on-stats/9708 "2012-11-14T01:01:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ashutosh\_Sharma](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Ashutosh\_Sharma](https://discuss.elastic.co/u/Ashutosh_Sharma)
#### Post date: [November 14, 2012, 1:01am UTC](https://discuss.elastic.co/t/clarification-needed-on-stats/9708/1 "2012-11-14T01:01:28Z")

</div>

Hi,

I am using elasticsearch to index the documents. I created a cluster of ES  
with 2 node work as master and node both. Below is the result of the  
\_cluster/health api:  
{  
"cluster\_name" : "es-cluster",  
"status" : "green",  
"timed\_out" : false,  
"number\_of\_nodes" : 2,  
"number\_of\_data\_nodes" : 2,  
"active\_primary\_shards" : 10,  
"active\_shards" : 20,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 0  
}

When I call the stats API, it prints the statistics about the index. I  
looked on the output docs:count and size of the index which is 174005 and  
138.2mb, marked blue as below. However, in total section, it shows docs:  
count: 348010 and size:276.4mb marked red as below. Could someone please  
explain this difference to me? Is this usual behavior or is something wrong  
with my configuration?

{"ok":true,"\_shards":{"total":10,"successful":10,"failed":0},"\_all":{"primaries":{  
"docs":{"count":174005,"deleted":0},"store":{"size":"138.2mb"  
,"size\_in\_bytes":144921313,"throttle\_time":"0s","throttle\_time\_in\_millis":0},  
"indexing":"index\_total":174005,"index\_time":"28.3s","index\_time\_in\_millis":28339,"index\_current":0,"delete\_total":0,"delete\_time":"0s","delete\_time\_in\_millis":0,"delete\_current":0},"get":"total":0,"time":"0s","time\_in\_millis":0,"exists\_total":0,"exists\_time":"0s","exists\_time\_in\_millis":0,"missing\_total":0,"missing\_time":"0s","missing\_time\_in\_millis":0,"current":0},  
"search":"query\_total":790,"query\_time":"1.1s","query\_time\_in\_millis":1134,"query\_current":0,"fetch\_total":55,"fetch\_time":"7ms","fetch\_time\_in\_millis":7,"fetch\_current":0}},"total":{  
"docs":{"count":348010,"deleted":0},"store":{"size":"276.4mb"  
,"size\_in\_bytes":289840531,"throttle\_time":"0s","throttle\_time\_in\_millis":0},"indexing":{"index\_total":348008,"index\_time":"56.9s","index\_time\_in\_millis":56906,"index\_current":0,"delete\_total":0,"delete\_time":"0s","delete\_time\_in\_millis":0,"delete\_current":0},"get":{"total":0,"time":"0s","time\_in\_millis":0,"exists\_total":0,"exists\_time":"0s","exists\_time\_in\_millis":0,"missing\_total":0,"missing\_time":"0s","missing\_time\_in\_millis":0,"current":0},"search":{"query\_total":1580,"query\_time":"2.2s","query\_time\_in\_millis":2293,"query\_current":0,"fetch\_total":109,"fetch\_time":"12ms","fetch\_time\_in\_millis":12,"fetch\_current":0}},"indices":{"txlog":{"primaries":{"docs":{"count":174005,"deleted":0},"store":{"size":"138.2mb","size\_in\_bytes":144921313,"throttle\_time":"0s","throttle\_time\_in\_millis":0},"indexing":{"index\_total":174005,"index\_time":"28.3s","index\_time\_in\_millis":28339,"index\_current":0,"delete\_total":0,"delete\_time":"0s","delete\_time\_in\_millis":0,"delete\_current":0},"get":{"total":0,"time":"0s","time\_in\_millis":0,"exists\_total":0,"exists\_time":"0s","exists\_time\_in\_millis":0,"missing\_total":0,"missing\_time":"0s","missing\_time\_in\_millis":0,"current":0},"search":{"query\_total":790,"query\_time":"1.1s","query\_time\_in\_millis":1134,"query\_current":0,"fetch\_total":55,"fetch\_time":"7ms","fetch\_time\_in\_millis":7,"fetch\_current":0}},"total":{"docs":{"count":348010,"deleted":0},"store":{"size":"276.4mb","size\_in\_bytes":289840531,"throttle\_time":"0s","throttle\_time\_in\_millis":0},"indexing":{"index\_total":348008,"index\_time":"56.9s","index\_time\_in\_millis":56906,"index\_current":0,"delete\_total":0,"delete\_time":"0s","delete\_time\_in\_millis":0,"delete\_current":0},"get":{"total":0,"time":"0s","time\_in\_millis":0,"exists\_total":0,"exists\_time":"0s","exists\_time\_in\_millis":0,"missing\_total":0,"missing\_time":"0s","missing\_time\_in\_millis":0,"current":0},"search":{"query\_total":1580,"query\_time":"2.2s","query\_time\_in\_millis":2293,"query\_current":0,"fetch\_total":109,"fetch\_time":"12ms","fetch\_time\_in\_millis":12,"fetch\_current":0}}}}}}

Thanks

Ashutosh

--

---

<div class="post-metadata">

### Author: ![Andrej](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Andrej](https://discuss.elastic.co/u/Andrej)
#### Post date: [November 14, 2012, 11:23am UTC](https://discuss.elastic.co/t/clarification-needed-on-stats/9708/2 "2012-11-14T11:23:04Z")

</div>

The answer is written in the stats:

"active\_primary\_shards" : 10,  
"active\_shards" : 20

Seems like you have 10 shards and 1 replica per shard. So "primaries":{  
"docs":{"count":174005 is for the primary shards and "total":{  
"docs":{"count":348010 is for total, including primaries and replicas.  
Therefore double number.

Greets  
Andrej

--

---

<div class="post-metadata">

### Author: ![Ashutosh\_Sharma](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Ashutosh\_Sharma](https://discuss.elastic.co/u/Ashutosh_Sharma)
#### Post date: [November 14, 2012, 1:22pm UTC](https://discuss.elastic.co/t/clarification-needed-on-stats/9708/3 "2012-11-14T13:22:06Z")

</div>

Thank you Andrej for the clarification. It means I should modify the cluster settings to configure shards and replicas. I'll have to add more nodes in near future.

Please suggest if you have any input on this.

Thanks  
Ashutosh

On Nov 14, 2012, at 8:23 PM, Andrej Rosenheinrich [andrej.rosenheinrich@unister.de](mailto:andrej.rosenheinrich@unister.de) wrote:

> The answer is written in the stats:
> 
> "active\_primary\_shards" : 10,  
> "active\_shards" : 20
> 
> Seems like you have 10 shards and 1 replica per shard. So "primaries":{"docs":{"count":174005 is for the primary shards and "total":{"docs":{"count":348010 is for total, including primaries and replicas. Therefore double number.
> 
> Greets  
> Andrej
> 
> --

--

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 3:04am UTC](https://discuss.elastic.co/t/clarification-needed-on-stats/9708/4 "2017-07-06T03:04:20Z")

</div>


