# Search hits number jumps up and down when updates documents

**URL:** <https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653>\
**Category:** Elasticsearch\
**Created:** [June 18, 2011, 8:57am UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653 "2011-06-18T08:57:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 18, 2011, 8:57am UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/1 "2011-06-18T08:57:32Z")

</div>

when i use bulk to update lots of documents (e.g. 20000), i found the  
search hits jump up and down, which is very confusing for users

ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 18, 2011, 6:14pm UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/2 "2011-06-18T18:14:35Z")

</div>

As you update documents, then the changes will be reflected to the user, that the near real time aspect of it. By default, the refresh interval will be 1 sec. You can disable refreshing using the update settings API (set the refresh interval to -1) and then enable it once you are done with bulk loading the data it it make sense to your use case.

On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:

> when i use bulk to update lots of documents (e.g. 20000), i found the  
> search hits jump up and down, which is very confusing for users
> 
> ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![Berkay\_Mollamustafao](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Berkay\_Mollamustafao](https://discuss.elastic.co/u/Berkay_Mollamustafao)\
**Post date:** [June 20, 2011, 2:44pm UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/3 "2011-06-20T14:44:14Z")

</div>

I think this is due to synchronization between replicas rather than refresh  
interval? The queries alternate between different replicas and since data  
may not yet replicated, users see results that fluctuate depending on which  
replica the query is executed against.

It is potentially a usability problem for users, and it can cause problems  
if the data is processed as it is written to ES, right?

Regards,  
Berkay Mollamustafaoglu  
mberkay on yahoo, google and skype

On Sat, Jun 18, 2011 at 2:14 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> As you update documents, then the changes will be reflected to the user,  
> that the near real time aspect of it. By default, the refresh interval will  
> be 1 sec. You can disable refreshing using the update settings API (set the  
> refresh interval to -1) and then enable it once you are done with bulk  
> loading the data it it make sense to your use case.
> 
> On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:
> 
> when i use bulk to update lots of documents (e.g. 20000), i found the  
> search hits jump up and down, which is very confusing for users
> 
> ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 21, 2011, 8:29am UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/4 "2011-06-21T08:29:07Z")

</div>

That can happen as well (though I don't think its the case here), though easily solvable with the preference feature in search: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/preference.html).

On Monday, June 20, 2011 at 5:44 PM, Berkay Mollamustafaoglu wrote:

> I think this is due to synchronization between replicas rather than refresh interval? The queries alternate between different replicas and since data may not yet replicated, users see results that fluctuate depending on which replica the query is executed against.
> 
> It is potentially a usability problem for users, and it can cause problems if the data is processed as it is written to ES, right?
> 
> Regards,  
> Berkay Mollamustafaoglu  
> mberkay on yahoo, google and skype
> 
> On Sat, Jun 18, 2011 at 2:14 PM, Shay Banon \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) ([mailto:shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com))\> wrote:
> 
> > As you update documents, then the changes will be reflected to the user, that the near real time aspect of it. By default, the refresh interval will be 1 sec. You can disable refreshing using the update settings API (set the refresh interval to -1) and then enable it once you are done with bulk loading the data it it make sense to your use case.
> > 
> > On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:
> > 
> > > when i use bulk to update lots of documents (e.g. 20000), i found the  
> > > search hits jump up and down, which is very confusing for users
> > > 
> > > ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 21, 2011, 12:37pm UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/5 "2011-06-21T12:37:49Z")

</div>

if i set it to \_primary, how can i do load balance? the single primary  
point will need to take all the coming request and as a result it have  
to take a high pressure as well as quick response

On Jun 21, 4:29 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> That can happen as well (though I don't think its the case here), though easily solvable with the preference feature in search:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/preference.html).
> 
> On Monday, June 20, 2011 at 5:44 PM, Berkay Mollamustafaoglu wrote:
> 
> > I think this is due to synchronization between replicas rather than refresh interval? The queries alternate between different replicas and since data may not yet replicated, users see results that fluctuate depending on which replica the query is executed against.
> 
> > It is potentially a usability problem for users, and it can cause problems if the data is processed as it is written to ES, right?
> 
> > Regards,  
> > Berkay Mollamustafaoglu  
> > mberkay on yahoo, google and skype
> 
> > On Sat, Jun 18, 2011 at 2:14 PM, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([mailto:shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com))\> wrote:
> > 
> > > As you update documents, then the changes will be reflected to the user, that the near real time aspect of it. By default, the refresh interval will be 1 sec. You can disable refreshing using the update settings API (set the refresh interval to -1) and then enable it once you are done with bulk loading the data it it make sense to your use case.
> 
> > > On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:
> 
> > > > when i use bulk to update lots of documents (e.g. 20000), i found the  
> > > > search hits jump up and down, which is very confusing for users
> 
> > > > ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 21, 2011, 1:11pm UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/6 "2011-06-21T13:11:47Z")

</div>

Check the docs, you can give it a unique value per user, for example, username, or sessionid.

On Tuesday, June 21, 2011 at 3:37 PM, Weiwei Wang wrote:

> if i set it to \_primary, how can i do load balance? the single primary  
> point will need to take all the coming request and as a result it have  
> to take a high pressure as well as quick response
> 
> On Jun 21, 4:29 pm, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([http://elasticsearch.com](http://elasticsearch.com))\> wrote:
> 
> > That can happen as well (though I don't think its the case here), though easily solvable with the preference feature in search:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/preference.html).
> > 
> > On Monday, June 20, 2011 at 5:44 PM, Berkay Mollamustafaoglu wrote:
> > 
> > > I think this is due to synchronization between replicas rather than refresh interval? The queries alternate between different replicas and since data may not yet replicated, users see results that fluctuate depending on which replica the query is executed against.
> > 
> > > It is potentially a usability problem for users, and it can cause problems if the data is processed as it is written to ES, right?
> > 
> > > Regards,  
> > > Berkay Mollamustafaoglu  
> > > mberkay on yahoo, google and skype
> > 
> > > On Sat, Jun 18, 2011 at 2:14 PM, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([mailto:shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([http://elasticsearch.com](http://elasticsearch.com)))\> wrote:
> > > 
> > > > As you update documents, then the changes will be reflected to the user, that the near real time aspect of it. By default, the refresh interval will be 1 sec. You can disable refreshing using the update settings API (set the refresh interval to -1) and then enable it once you are done with bulk loading the data it it make sense to your use case.
> > 
> > > > On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:
> > 
> > > > > when i use bulk to update lots of documents (e.g. 20000), i found the  
> > > > > search hits jump up and down, which is very confusing for users
> > 
> > > > > ps: i used ES for real time search

---

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 22, 2011, 2:40am UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/7 "2011-06-22T02:40:45Z")

</div>

gotcha, thanks shay~

On Jun 21, 9:11 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Check the docs, you can give it a unique value per user, for example, username, or sessionid.
> 
> On Tuesday, June 21, 2011 at 3:37 PM, Weiwei Wang wrote:
> 
> > if i set it to \_primary, how can i do load balance? the single primary  
> > point will need to take all the coming request and as a result it have  
> > to take a high pressure as well as quick response
> 
> > On Jun 21, 4:29 pm, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([http://elasticsearch.com](http://elasticsearch.com))\> wrote:
> > 
> > > That can happen as well (though I don't think its the case here), though easily solvable with the preference feature in search:[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/preference.html).
> 
> > > On Monday, June 20, 2011 at 5:44 PM, Berkay Mollamustafaoglu wrote:
> > > 
> > > > I think this is due to synchronization between replicas rather than refresh interval? The queries alternate between different replicas and since data may not yet replicated, users see results that fluctuate depending on which replica the query is executed against.
> 
> > > > It is potentially a usability problem for users, and it can cause problems if the data is processed as it is written to ES, right?
> 
> > > > Regards,  
> > > > Berkay Mollamustafaoglu  
> > > > mberkay on yahoo, google and skype
> 
> > > > On Sat, Jun 18, 2011 at 2:14 PM, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([mailto:shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([http://elasticsearch.com](http://elasticsearch.com)))\> wrote:
> > > > 
> > > > > As you update documents, then the changes will be reflected to the user, that the near real time aspect of it. By default, the refresh interval will be 1 sec. You can disable refreshing using the update settings API (set the refresh interval to -1) and then enable it once you are done with bulk loading the data it it make sense to your use case.
> 
> > > > > On Saturday, June 18, 2011 at 11:57 AM, Weiwei Wang wrote:
> 
> > > > > > when i use bulk to update lots of documents (e.g. 20000), i found the  
> > > > > > search hits jump up and down, which is very confusing for users
> 
> > > > > > ps: i used ES for real time search

---

<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, 4:02am UTC](https://discuss.elastic.co/t/search-hits-number-jumps-up-and-down-when-updates-documents/4653/8 "2017-07-06T04:02:59Z")

</div>


