# Near Realtime Question

**URL:** <https://discuss.elastic.co/t/near-realtime-question/3519>\
**Category:** Elasticsearch\
**Created:** [November 4, 2010, 7:12pm UTC](https://discuss.elastic.co/t/near-realtime-question/3519 "2010-11-04T19:12:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [November 4, 2010, 7:12pm UTC](https://discuss.elastic.co/t/near-realtime-question/3519/1 "2010-11-04T19:12:04Z")

</div>

We are using ElasticSearch as a datastore in place of a database. Kimchy  
will be quick to add that this is not advisable at the moment due to its  
beta status. (We also dupe data to MySQL for the present time.)

For most of our use cases, we do fine with ES NRT, but there are a few spots  
when we have to issue a refresh before continuing. I was wondering if it  
would be possible to add a parameter (similar to op\_type) that can be passed  
along with a POST or PUT to indicate that the call should not reply until  
the document is indexed.

We have a multi-tier system, and this would help us by not requiring two  
REST calls from the middle tier to our web services tier where ES lives.

-- jim

---

<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:** [November 4, 2010, 7:20pm UTC](https://discuss.elastic.co/t/near-realtime-question/3519/2 "2010-11-04T19:20:15Z")

</div>

Hi,

First, the document is always indexed, and added to a transaction log  
before the operations returned. Its the visibility of it for search that is  
near real time. And yes, there is a flag for that, index and delete APIs  
accept a refresh parameter that will cause the relevant shard they hit to  
refresh before returning a result (note, found a small problem with it in  
0.12, fixed in master).

-shay.banon

On Thu, Nov 4, 2010 at 9:12 PM, James Cook [jcook@tracermedia.com](mailto:jcook@tracermedia.com) wrote:

> We are using Elasticsearch as a datastore in place of a database. Kimchy  
> will be quick to add that this is not advisable at the moment due to its  
> beta status. (We also dupe data to MySQL for the present time.)
> 
> For most of our use cases, we do fine with ES NRT, but there are a few  
> spots when we have to issue a refresh before continuing. I was wondering if  
> it would be possible to add a parameter (similar to op\_type) that can be  
> passed along with a POST or PUT to indicate that the call should not reply  
> until the document is indexed.
> 
> We have a multi-tier system, and this would help us by not requiring two  
> REST calls from the middle tier to our web services tier where ES lives.
> 
> -- jim

---

<div class="post-metadata">

**Author:** ![James\_Cook](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@James\_Cook](https://discuss.elastic.co/u/James_Cook)\
**Post date:** [November 4, 2010, 7:51pm UTC](https://discuss.elastic.co/t/near-realtime-question/3519/3 "2010-11-04T19:51:29Z")

</div>

🙂

Awesome, didn't know that parameter existed.

On Thu, Nov 4, 2010 at 3:20 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Hi,
> 
> First, the document is always indexed, and added to a transaction log  
> before the operations returned. Its the visibility of it for search that is  
> near real time. And yes, there is a flag for that, index and delete APIs  
> accept a refresh parameter that will cause the relevant shard they hit to  
> refresh before returning a result (note, found a small problem with it in  
> 0.12, fixed in master).
> 
> -shay.banon
> 
> On Thu, Nov 4, 2010 at 9:12 PM, James Cook [jcook@tracermedia.com](mailto:jcook@tracermedia.com) wrote:
> 
> > We are using Elasticsearch as a datastore in place of a database. Kimchy  
> > will be quick to add that this is not advisable at the moment due to its  
> > beta status. (We also dupe data to MySQL for the present time.)
> > 
> > For most of our use cases, we do fine with ES NRT, but there are a few  
> > spots when we have to issue a refresh before continuing. I was wondering if  
> > it would be possible to add a parameter (similar to op\_type) that can be  
> > passed along with a POST or PUT to indicate that the call should not reply  
> > until the document is indexed.
> > 
> > We have a multi-tier system, and this would help us by not requiring two  
> > REST calls from the middle tier to our web services tier where ES lives.
> > 
> > -- jim

---

<div class="post-metadata">

**Author:** ![Diptamay](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diptamay/32/2805_2.png) [@Diptamay](https://discuss.elastic.co/u/Diptamay)\
**Post date:** [November 4, 2010, 8:05pm UTC](https://discuss.elastic.co/t/near-realtime-question/3519/4 "2010-11-04T20:05:08Z")

</div>

You could alternately perform with version 0.12.1  
\_client.admin().indices().prepareRefresh("index").execute(); since the  
refresh boolean parameter ain't being honored in 0.12.1.

On Nov 4, 3:51 pm, James Cook [jc...@tracermedia.com](mailto:jc...@tracermedia.com) wrote:

> 🙂
> 
> Awesome, didn't know that parameter existed.
> 
> On Thu, Nov 4, 2010 at 3:20 PM, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com)wrote:
> 
> > Hi,
> 
> > First, the document is always indexed, and added to a transaction log  
> > before the operations returned. Its the visibility of it for search that is  
> > near real time. And yes, there is a flag for that, index and delete APIs  
> > accept a refresh parameter that will cause the relevant shard they hit to  
> > refresh before returning a result (note, found a small problem with it in  
> > 0.12, fixed in master).
> 
> > -shay.banon
> 
> > On Thu, Nov 4, 2010 at 9:12 PM, James Cook [jc...@tracermedia.com](mailto:jc...@tracermedia.com) wrote:
> 
> > > We are using Elasticsearch as a datastore in place of a database. Kimchy  
> > > will be quick to add that this is not advisable at the moment due to its  
> > > beta status. (We also dupe data to MySQL for the present time.)
> 
> > > For most of our use cases, we do fine with ES NRT, but there are a few  
> > > spots when we have to issue a refresh before continuing. I was wondering if  
> > > it would be possible to add a parameter (similar to op\_type) that can be  
> > > passed along with a POST or PUT to indicate that the call should not reply  
> > > until the document is indexed.
> 
> > > We have a multi-tier system, and this would help us by not requiring two  
> > > REST calls from the middle tier to our web services tier where ES lives.
> 
> > > -- jim

---

<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:17am UTC](https://discuss.elastic.co/t/near-realtime-question/3519/5 "2017-07-06T04:17:09Z")

</div>


