# While updating a document, query by range return duplicate documents

**URL:** https://discuss.elastic.co/t/while-updating-a-document-query-by-range-return-duplicate-documents/12807
**Category:** Elasticsearch
**Created:** [July 16, 2013, 10:06am UTC](https://discuss.elastic.co/t/while-updating-a-document-query-by-range-return-duplicate-documents/12807 "2013-07-16T10:06:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![anson](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@anson](https://discuss.elastic.co/u/anson)
#### Post date: [July 16, 2013, 10:06am UTC](https://discuss.elastic.co/t/while-updating-a-document-query-by-range-return-duplicate-documents/12807/1 "2013-07-16T10:06:26Z")

</div>

Encounter a very odd situation. Anyone meet it before?

For example, there is 1000 documents in a index.

While my program is updating documents (by docid), i want to get all  
documents in this index. I do such by query by range (from x size y) in  
one loop. Finally, i get the right number documents (size is 1000),  
but in documents there are many duplicate documents (same document).

At last, have to restart the cluster and do the same step above, The issue  
missing.

Wonder what cause this weird situation?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:26am UTC](https://discuss.elastic.co/t/while-updating-a-document-query-by-range-return-duplicate-documents/12807/2 "2017-07-06T02:26:14Z")

</div>


