# Lucene doc id in the fetch phase

**URL:** <https://discuss.elastic.co/t/lucene-doc-id-in-the-fetch-phase/8464>\
**Category:** Elasticsearch\
**Created:** [July 19, 2012, 10:35am UTC](https://discuss.elastic.co/t/lucene-doc-id-in-the-fetch-phase/8464 "2012-07-19T10:35:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vince](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vince](https://discuss.elastic.co/u/vince)\
**Post date:** [July 19, 2012, 10:35am UTC](https://discuss.elastic.co/t/lucene-doc-id-in-the-fetch-phase/8464/1 "2012-07-19T10:35:35Z")

</div>

As we know, the doc id of a document in Lucene may change after reopening  
the IndexReader.  
In the fetch phase of ElasticSearch, the document content is got by lucene  
doc id.  
A wrong document may be returned to the client, if the IndexReader reopened  
between query phase and fetch phase.  
How this problem is sovled in ElasticSearhc?

---

<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:19am UTC](https://discuss.elastic.co/t/lucene-doc-id-in-the-fetch-phase/8464/2 "2017-07-06T03:19:50Z")

</div>


