# Lucene max documents limit

**URL:** <https://discuss.elastic.co/t/lucene-max-documents-limit/34761>\
**Category:** Elasticsearch\
**Created:** [November 17, 2015, 7:40am UTC](https://discuss.elastic.co/t/lucene-max-documents-limit/34761 "2015-11-17T07:40:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siddartha\_Guthikonda](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Siddartha\_Guthikonda](https://discuss.elastic.co/u/Siddartha_Guthikonda)\
**Post date:** [November 17, 2015, 7:40am UTC](https://discuss.elastic.co/t/lucene-max-documents-limit/34761/1 "2015-11-17T07:40:47Z")

</div>

I am getting, java.lang.IllegalArgumentException: number of documents in the index cannot exceed 2147483519,

which is due to the sheer number nested documents in elastic search. Looks like lucene treats each nested document as an individual doc so comes the issue.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2015, 9:02am UTC](https://discuss.elastic.co/t/lucene-max-documents-limit/34761/2 "2015-11-17T09:02:33Z")

</div>

Yep, there is a 2^31 limit per shard in Lucene.

---

<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 5, 2017, 11:38pm UTC](https://discuss.elastic.co/t/lucene-max-documents-limit/34761/3 "2017-07-05T23:38:01Z")

</div>


