# Messages getting lost while insertion

**URL:** <https://discuss.elastic.co/t/messages-getting-lost-while-insertion/5367>\
**Category:** Elasticsearch\
**Created:** [September 13, 2011, 9:18am UTC](https://discuss.elastic.co/t/messages-getting-lost-while-insertion/5367 "2011-09-13T09:18:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spokarna](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@spokarna](https://discuss.elastic.co/u/spokarna)\
**Post date:** [September 13, 2011, 9:18am UTC](https://discuss.elastic.co/t/messages-getting-lost-while-insertion/5367/1 "2011-09-13T09:18:59Z")

</div>

Hi All,  
I am writing messages into elasticsearch using a single thread, and using  
the call:  
transportClient.prepareIndex(index, type, id)  
.setSource(node)  
.execute()  
.actionGet();  
If I write messages continuously, I observe that some messages are lost  
somewhere in transit, and my query returns less entries than I write.

If I use elasticsearchhead UI, I see the status of the index as  
test  
size: 68.9mb (68.9mb)  
docs: 42795 (42820)

My index status returns:  
docs: {

- num\_docs: 42795
- max\_doc: 42820
- deleted\_docs: 25

}

The max\_docs is less than the number of entries that I pushed into  
ElasticSearch. And why are some messages marked as deleted?  
I am using ElasticSearch 0.16.2.

Regards,  
Sameer

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [September 14, 2011, 3:22pm UTC](https://discuss.elastic.co/t/messages-getting-lost-while-insertion/5367/2 "2011-09-14T15:22:07Z")

</div>

Sameer,

Are you updating documents that already exist in the index? When you  
update a document (insert a document with an existing id), then the  
old document gets deleted and the new one inserted. The deleted  
document will disappear once a merge occurs.

Ivan

On Tue, Sep 13, 2011 at 5:18 AM, Sameer Pokarna [sameerpokarna@gmail.com](mailto:sameerpokarna@gmail.com) wrote:

> Hi All,  
> I am writing messages into elasticsearch using a single thread, and using  
> the call:  
> transportClient.prepareIndex(index, type, id)  
> .setSource(node)  
> .execute()  
> .actionGet();  
> If I write messages continuously, I observe that some messages are lost  
> somewhere in transit, and my query returns less entries than I write.  
> If I use elasticsearchhead UI, I see the status of the index as  
> test  
> size: 68.9mb (68.9mb)  
> docs: 42795 (42820)  
> My index status returns:  
> docs: {
> 
> num\_docs: 42795  
> max\_doc: 42820  
> deleted\_docs: 25
> 
> }  
> The max\_docs is less than the number of entries that I pushed into  
> Elasticsearch. And why are some messages marked as deleted?  
> I am using Elasticsearch 0.16.2.
> 
> Regards,  
> Sameer

---

<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:54am UTC](https://discuss.elastic.co/t/messages-getting-lost-while-insertion/5367/3 "2017-07-06T03:54:23Z")

</div>


