# Can documents returned during fetch phase have changed since query phase

**URL:** <https://discuss.elastic.co/t/can-documents-returned-during-fetch-phase-have-changed-since-query-phase/305773>\
**Category:** Elasticsearch\
**Created:** [May 27, 2022, 7:46am UTC](https://discuss.elastic.co/t/can-documents-returned-during-fetch-phase-have-changed-since-query-phase/305773 "2022-05-27T07:46:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidbkemp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidbkemp/32/594_2.png) [@davidbkemp](https://discuss.elastic.co/u/davidbkemp)\
**Post date:** [May 27, 2022, 7:46am UTC](https://discuss.elastic.co/t/can-documents-returned-during-fetch-phase-have-changed-since-query-phase/305773/1 "2022-05-27T07:46:15Z")

</div>

Our system assumes the documents returned by a search actually satisfy the query. Is it possible that, if a document is modified between the query and fetch phases of a search that the returned document doesn’t actually satisfy the query?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [May 30, 2022, 3:08pm UTC](https://discuss.elastic.co/t/can-documents-returned-during-fetch-phase-have-changed-since-query-phase/305773/2 "2022-05-30T15:08:46Z")

</div>

It'd be a bug if it happened. The query phase pins a snapshot of documents that is re-used by the fetch phase. Even if the document is modified between the fetch and query phase you should get back the "old" version of the document. Same for deletes - you'll get back the deleted document. Think of it as a very limited, shard focused version of "repeatable read".

---

<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:** [June 27, 2022, 3:09pm UTC](https://discuss.elastic.co/t/can-documents-returned-during-fetch-phase-have-changed-since-query-phase/305773/3 "2022-06-27T15:09:02Z")

</div>

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