# Error for too many documents, API says we are still below the limit

**URL:** https://discuss.elastic.co/t/error-for-too-many-documents-api-says-we-are-still-below-the-limit/208575
**Category:** Elasticsearch
**Created:** [November 19, 2019, 8:08pm UTC](https://discuss.elastic.co/t/error-for-too-many-documents-api-says-we-are-still-below-the-limit/208575 "2019-11-19T20:08:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![holgr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/holgr/32/2874_2.png) [@holgr](https://discuss.elastic.co/u/holgr)
#### Post date: [November 19, 2019, 8:08pm UTC](https://discuss.elastic.co/t/error-for-too-many-documents-api-says-we-are-still-below-the-limit/208575/1 "2019-11-19T20:08:05Z")

</div>

While indexing new documents we've recently started getting errors for having too many (java.lang.IllegalArgumentException: number of documents in the index cannot exceed 2147483519).

We are aware of this limit, but looking at our numbers per shard, we aren't quite sure how we are hitting it? We are still quite a few docs away.

/\_cat/shards?pretty results in (edited for readability):  
our-index 2 r STARTED 1898146592  
our-index 2 p STARTED 1898146572  
our-index 2 r STARTED 1898146592  
our-index 3 r STARTED 1402285175  
our-index 3 p STARTED 1402285818  
our-index 3 r STARTED 1402284441  
our-index 4 p STARTED 677430317  
our-index 4 r STARTED 677430212  
our-index 4 r STARTED 677429764  
our-index 1 p STARTED 688333390  
our-index 1 r STARTED 688333305  
our-index 1 r STARTED 685486884  
our-index 0 r STARTED 1371042072  
our-index 0 r STARTED 1371041952  
our-index 0 p STARTED 1371042386

We've been thinking this might be due to nested documents, but if that's the case we have yet to find an API that lists a total number of docs per shard.

Any ideas would be greatly appreciated?

---

<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: [December 17, 2019, 8:08pm UTC](https://discuss.elastic.co/t/error-for-too-many-documents-api-says-we-are-still-below-the-limit/208575/2 "2019-12-17T20:08:11Z")

</div>

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