# the maximum number of documents in an elasticsearch index and difference about stats and count

**URL:** https://discuss.elastic.co/t/the-maximum-number-of-documents-in-an-elasticsearch-index-and-difference-about-stats-and-count/361328
**Category:** Elasticsearch
**Created:** [June 12, 2024, 1:40pm UTC](https://discuss.elastic.co/t/the-maximum-number-of-documents-in-an-elasticsearch-index-and-difference-about-stats-and-count/361328 "2024-06-12T13:40:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Vincenzo\_Picarelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincenzo_picarelli/32/124149_2.png) [@Vincenzo\_Picarelli](https://discuss.elastic.co/u/Vincenzo_Picarelli)
#### Post date: [June 12, 2024, 1:40pm UTC](https://discuss.elastic.co/t/the-maximum-number-of-documents-in-an-elasticsearch-index-and-difference-about-stats-and-count/361328/1 "2024-06-12T13:40:57Z")

</div>

I have an index in elasticsearch with only 1 primary shards e 0 replica.  
When I do GET /index/\_count, the result is 100,815.  
When I do GET /index/\_stats, the result is 64,893,983. Each doc has nested fields.  
My question is: what number do I have to consider for the limit Number of documents in the index can't exceed [2147483519]?

In case of the second one number, do you suggest to increase the number of primary shards? I have only one pc.  
Thank you

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [June 12, 2024, 2:02pm UTC](https://discuss.elastic.co/t/the-maximum-number-of-documents-in-an-elasticsearch-index-and-difference-about-stats-and-count/361328/2 "2024-06-12T14:02:24Z")

</div>

Yes, I believe you need to include nested documents in the count. In order to increase the number of primary shards you will need to either use the [split index API](https://www.elastic.co/guide/en/elasticsearch/reference/8.14/indices-split-index.html) to create a new index based on the existing one or reindex into a new index.

Not that the limit is per shard and not index (as stated in your title).
