# DocumentMissingException ScanScroll

**URL:** <https://discuss.elastic.co/t/documentmissingexception-scanscroll/20986>\
**Category:** Elasticsearch\
**Created:** [November 29, 2014, 12:08pm UTC](https://discuss.elastic.co/t/documentmissingexception-scanscroll/20986 "2014-11-29T12:08:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)\
**Post date:** [November 29, 2014, 12:08pm UTC](https://discuss.elastic.co/t/documentmissingexception-scanscroll/20986/1 "2014-11-29T12:08:19Z")

</div>

Hi

Client JavaAPI  
Version 1.2.1  
Requests: bulk  
(no parent child mapping)  
Does use nested structure.

Using scan and scroll to populate thousands (maybe millions) of delete  
requests. It works like this:

Scan Search (for all documents with field f = 'the value')

> Scroll in batches of say 1000:  
> create bulk delete requests and execute;  
> repeat until the end

This used to work no problem.

But now giving apparently random DocumentMissingException

Can't think why this might happen.

The mappings have been added to over time. Would that matter? I have heard  
of the need to re-index.

I'm not even sure if the DocumentMissingException meant that the document  
was there initially.

It could be a bug in the code. But it's single threaded and I can't see  
how, if the document was there during the scan it's not there at the delete?

Anybody suggest what might be happening?

Obvious workaround is to simply ignore DocumentMissingException on delete  
.. but why

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0ccf1a0e-418e-4002-9c74-ba10e20b7dfd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0ccf1a0e-418e-4002-9c74-ba10e20b7dfd%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![eunever32](https://avatars.discourse-cdn.com/v4/letter/e/e68b1a/32.png) [@eunever32](https://discuss.elastic.co/u/eunever32)\
**Post date:** [December 1, 2014, 12:13pm UTC](https://discuss.elastic.co/t/documentmissingexception-scanscroll/20986/2 "2014-12-01T12:13:43Z")

</div>

yikes found it!

But in _my_ code, ES is fine!

On Saturday, November 29, 2014 12:08:19 PM UTC, [eune...@gmail.com](mailto:eune...@gmail.com) wrote:

> Hi
> 
> Client JavaAPI  
> Version 1.2.1  
> Requests: bulk  
> (no parent child mapping)  
> Does use nested structure.
> 
> Using scan and scroll to populate thousands (maybe millions) of delete  
> requests. It works like this:
> 
> Scan Search (for all documents with field f = 'the value')
> 
> > Scroll in batches of say 1000:  
> > create bulk delete requests and execute;  
> > repeat until the end
> 
> This used to work no problem.
> 
> But now giving apparently random DocumentMissingException
> 
> Can't think why this might happen.
> 
> The mappings have been added to over time. Would that matter? I have heard  
> of the need to re-index.
> 
> I'm not even sure if the DocumentMissingException meant that the document  
> was there initially.
> 
> It could be a bug in the code. But it's single threaded and I can't see  
> how, if the document was there during the scan it's not there at the delete?
> 
> Anybody suggest what might be happening?
> 
> Obvious workaround is to simply ignore DocumentMissingException on delete  
> .. but why
> 
> Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d94413ef-bc1e-4879-a607-62ca1f802203%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d94413ef-bc1e-4879-a607-62ca1f802203%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:46am UTC](https://discuss.elastic.co/t/documentmissingexception-scanscroll/20986/3 "2017-07-06T00:46:52Z")

</div>


