# Failed to execute index. number of documents in the index cannot exceed 2147483519

**URL:** https://discuss.elastic.co/t/failed-to-execute-index-number-of-documents-in-the-index-cannot-exceed-2147483519/238124
**Category:** Elasticsearch
**Created:** [June 22, 2020, 4:44pm UTC](https://discuss.elastic.co/t/failed-to-execute-index-number-of-documents-in-the-index-cannot-exceed-2147483519/238124 "2020-06-22T16:44:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DucTran](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@DucTran](https://discuss.elastic.co/u/DucTran)
#### Post date: [June 22, 2020, 4:44pm UTC](https://discuss.elastic.co/t/failed-to-execute-index-number-of-documents-in-the-index-cannot-exceed-2147483519/238124/1 "2020-06-22T16:44:20Z")

</div>

Hi Guys,

I am having problems with the capacity of ElasticSearch as below.  
I'm understanding the number od docs per shard reached to maximum number - 2147483519. I deleted many docs but the error continues, Elasticsearch cannot continue indexing new records.  
**Can you guide me how to reuse the deleted space for new data can be indexing?**

[2020-06-22 23:25:11,345][DEBUG][action.index] [-DC2] [call-recordingv2-vn-fd82eaac-e6a5-4670-a50f-5bf913f2dd8a][1], node[p7QiwMPVTSeQMirAwq1TxA], [P], s[STARTED]: Failed to execute [index {[call-recordingv2-vn-fd82eaac-e6a5-4670-a50f-5bf913f2dd8a][CallRecordings][DNTJ90SGQ17GL5VGLTFKETGRNO0038FJ]}]  
java.lang.IllegalArgumentException: number of documents in the index cannot exceed 2147483519  
at org.apache.lucene.index.DocumentsWriterPerThread.reserveOneDoc(DocumentsWriterPerThread.java:218)  
at org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:277)  
at org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:424)  
at org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1353)  
at org.apache.lucene.index.IndexWriter.addDocuments(IndexWriter.java:1311)  
at org.elasticsearch.index.engine.InternalEngine.innerIndex(InternalEngine.java:430)  
at org.elasticsearch.index.engine.InternalEngine.index(InternalEngine.java:364)  
at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:510)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:196)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase.performOnPrimary(TransportShardReplicationOperationAction.java:574)  
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1.doRun(TransportShardReplicationOperationAction.java:440)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:36)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at java.lang.Thread.run(Thread.java:748)

**The number of docs per shard:**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f44ee16b23a1195d63faa02460bd1e451fbd89f0.png)

**:9200/\_cat/indices?v**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/6/06bd5a5f60b71decf1d5e573081f0992e8a72954.png)

---

<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: [June 23, 2020, 10:43pm UTC](https://discuss.elastic.co/t/failed-to-execute-index-number-of-documents-in-the-index-cannot-exceed-2147483519/238124/2 "2020-06-23T22:43:31Z")

</div>

Welcome to our community! 😃  
Please don't post pictures of text, they are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

After you deleted the documents, did you run a [force merge](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html) on the indices?

---

<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 21, 2020, 10:43pm UTC](https://discuss.elastic.co/t/failed-to-execute-index-number-of-documents-in-the-index-cannot-exceed-2147483519/238124/3 "2020-07-21T22:43:38Z")

</div>

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