# Searching while indexing

**URL:** <https://discuss.elastic.co/t/searching-while-indexing/15654>\
**Category:** Elasticsearch\
**Created:** [February 7, 2014, 3:41am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654 "2014-02-07T03:41:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![IronMike](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@IronMike](https://discuss.elastic.co/u/IronMike)\
**Post date:** [February 7, 2014, 3:41am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654/1 "2014-02-07T03:41:43Z")

</div>

I am unclear on how does searching work while indexing. lets say I already  
have a document indexed (version 1), and I updated the document, so I will  
index it again (version 2), what happens when the user is searching while  
indexing version 2? Will the user get results from version 1?

--  
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/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 7, 2014, 6:12am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654/2 "2014-02-07T06:12:48Z")

</div>

Yes.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 févr. 2014 à 04:41, ZenMaster80 [sabdalla80@gmail.com](mailto:sabdalla80@gmail.com) a écrit :

## I am unclear on how does searching work while indexing. lets say I already have a document indexed (version 1), and I updated the document, so I will index it again (version 2), what happens when the user is searching while indexing version 2? Will the user get results from version 1?

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/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 7, 2014, 6:18am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654/3 "2014-02-07T06:18:47Z")

</div>

Yes, as ES is eventually consistent.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 7 February 2014 17:12, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Yes.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 7 févr. 2014 à 04:41, ZenMaster80 [sabdalla80@gmail.com](mailto:sabdalla80@gmail.com) a écrit :
> 
> I am unclear on how does searching work while indexing. lets say I already  
> have a document indexed (version 1), and I updated the document, so I will  
> index it again (version 2), what happens when the user is searching while  
> indexing version 2? Will the user get results from version 1?
> 
> --  
> 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/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAEM624b2jZJPhGrt2fs-EzV%2BieDZ8\_MFkoO\_V5\_k\_pyRtXjH5A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624b2jZJPhGrt2fs-EzV%2BieDZ8_MFkoO_V5_k_pyRtXjH5A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Randall\_McRee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/randall_mcree/32/47177_2.png) [@Randall\_McRee](https://discuss.elastic.co/u/Randall_McRee)\
**Post date:** [February 11, 2014, 12:06am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654/4 "2014-02-11T00:06:47Z")

</div>

Well, good grief, the answer to the poster's original question is PERHAPS  
(not yes!). It depends on the timing between the search request and the  
(asynchronous) indexing. There is a short (but finite) amount of time after  
the update request that a search will still return the previous version. At  
some point in time (this is the eventually part) that window will close and  
the updated, just indexed document will be returned.

Also, if the search request happened before the indexing and the client is  
pulling results back using scrolling or scanning then he definitely will  
not see the update, I think.

On Thu, Feb 6, 2014 at 10:18 PM, Mark Walkom [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)wrote:

> Yes, as ES is eventually consistent.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 7 February 2014 17:12, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Yes.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 7 févr. 2014 à 04:41, ZenMaster80 [sabdalla80@gmail.com](mailto:sabdalla80@gmail.com) a écrit :
> > 
> > I am unclear on how does searching work while indexing. lets say I  
> > already have a document indexed (version 1), and I updated the document, so  
> > I will index it again (version 2), what happens when the user is searching  
> > while indexing version 2? Will the user get results from version 1?
> > 
> > --  
> > 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/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0fb1e6fe-0d96-4d35-b155-f9de87e5c1f7%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > 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/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/3A407209-C2E5-4C8D-A7CB-B8340048CE30%40pilato.fr)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> 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/CAEM624b2jZJPhGrt2fs-EzV%2BieDZ8\_MFkoO\_V5\_k\_pyRtXjH5A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624b2jZJPhGrt2fs-EzV%2BieDZ8_MFkoO_V5_k_pyRtXjH5A%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAFjHw34gVr5YPqS7t1r14n4F3p-tHFdtRngLiv-Avb7rcTLavg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAFjHw34gVr5YPqS7t1r14n4F3p-tHFdtRngLiv-Avb7rcTLavg%40mail.gmail.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, 1:51am UTC](https://discuss.elastic.co/t/searching-while-indexing/15654/5 "2017-07-06T01:51:18Z")

</div>


