# Java API synchronous vs asynchronous?

**URL:** https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985
**Category:** Elasticsearch
**Created:** [April 13, 2014, 3:09am UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985 "2014-04-13T03:09:38Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![echin1999\_2](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@echin1999\_2](https://discuss.elastic.co/u/echin1999_2)
#### Post date: [April 13, 2014, 3:09am UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/1 "2014-04-13T03:09:38Z")

</div>

Hi.

I'm adding to my elasticSearch database (v. 0.90) an object via this java  
call.

_IndexResponse response = \_client.prepareIndex(SomeIndex, SomeType,  
SomeId).setSource(SomeJSON).execute().actionGet();_

If I do a search for this object immediately after, i notice i sometimes  
don't find it. I assume this is because it is an asynchronous call. Is  
that correct?  
The documentation mentions the following:

The index API allows to set the threading model the operation will be  
performed when the actual execution of the API is performed on the same  
node (the API is executed on a shard that is allocated on the same server).

The options are to execute the operation on a different thread, or to  
execute it on the calling thread (note that the API is still async). By  
default, operationThreaded is set totrue which means the operation is  
executed on a different thread.

Will setting operationThreaded to false guarantee that the object be  
available for search immediately after? The snippet above mentions _"(note  
that the API is still async)"_ - so I'm guessing no. Is there a way to  
make the api call synchronous so i can be assured that on my next search  
for the object, it will definitely be there?

thanks  
Ed

--  
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/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [April 13, 2014, 5:47am UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/2 "2014-04-13T05:47:11Z")

</div>

It won't be searchable until the next refresh.  
GET is real time.  
SEARCH is near real time.

That could explain here.

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

Le 13 avr. 2014 à 05:09, echin1999 [echin1999@gmail.com](mailto:echin1999@gmail.com) a écrit :

Hi.

I'm adding to my elasticSearch database (v. 0.90) an object via this java call.

IndexResponse response = \_client.prepareIndex(SomeIndex, SomeType, SomeId).setSource(SomeJSON).execute().actionGet();

If I do a search for this object immediately after, i notice i sometimes don't find it. I assume this is because it is an asynchronous call. Is that correct?

The documentation mentions the following:

The index API allows to set the threading model the operation will be performed when the actual execution of the API is performed on the same node (the API is executed on a shard that is allocated on the same server).

The options are to execute the operation on a different thread, or to execute it on the calling thread (note that the API is still async). By default, operationThreaded is set totrue which means the operation is executed on a different thread.

Will setting operationThreaded to false guarantee that the object be available for search immediately after? The snippet above mentions "(note that the API is still async)" - so I'm guessing no. Is there a way to make the api call synchronous so i can be assured that on my next search for the object, it will definitely be there?

## thanks Ed

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/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CFA2AD64-8C61-44E7-A63A-79B02B257EE5%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/CFA2AD64-8C61-44E7-A63A-79B02B257EE5%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![echin1999\_2](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@echin1999\_2](https://discuss.elastic.co/u/echin1999_2)
#### Post date: [April 13, 2014, 1:56pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/3 "2014-04-13T13:56:52Z")

</div>

> > I see. From looking at the documentation for "refresh" it looks like the default interval is 1 second? so yes, that would explain my scenario. I wasn't aware of the "refresh".
> > 
> > do you know if the interval can be decreased to less than a second? I understand there is impact to the performance of indexing if this value is lowered. Is there also impact to searching with respect to this interval?
> > 
> > thanks!  
> > Ed

On Apr 13, 2014, at 1:47 AM, David Pilato wrote:

> It won't be searchable until the next refresh.  
> GET is real time.  
> SEARCH is near real time.
> 
> That could explain here.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 13 avr. 2014 à 05:09, echin1999 [echin1999@gmail.com](mailto:echin1999@gmail.com) a écrit :
> 
> Hi.
> 
> I'm adding to my elasticSearch database (v. 0.90) an object via this java call.
> 
> IndexResponse response = \_client.prepareIndex(SomeIndex, SomeType, SomeId).setSource(SomeJSON).execute().actionGet();
> 
> If I do a search for this object immediately after, i notice i sometimes don't find it. I assume this is because it is an asynchronous call. Is that correct?
> 
> The documentation mentions the following:
> 
> The index API allows to set the threading model the operation will be performed when the actual execution of the API is performed on the same node (the API is executed on a shard that is allocated on the same server).
> 
> The options are to execute the operation on a different thread, or to execute it on the calling thread (note that the API is still async). By default, operationThreaded is set totrue which means the operation is executed on a different thread.
> 
> Will setting operationThreaded to false guarantee that the object be available for search immediately after? The snippet above mentions "(note that the API is still async)" - so I'm guessing no. Is there a way to make the api call synchronous so i can be assured that on my next search for the object, it will definitely be there?
> 
> thanks  
> Ed
> 
> --  
> 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/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/766927ea-6943-44f5-8da2-997d1ff1b2f6%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe](https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CFA2AD64-8C61-44E7-A63A-79B02B257EE5%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/CFA2AD64-8C61-44E7-A63A-79B02B257EE5%40pilato.fr).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/1A41EBDC-7539-4BAC-8C69-2B17B33ADCD0%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/1A41EBDC-7539-4BAC-8C69-2B17B33ADCD0%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [April 13, 2014, 2:47pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/4 "2014-04-13T14:47:04Z")

</div>

Look at IndexRequestBuilder, there is a method setRefresh(true) so you can  
enforce a post refresh per index request.

Jörg

--  
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/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![echin1999\_2](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@echin1999\_2](https://discuss.elastic.co/u/echin1999_2)
#### Post date: [April 13, 2014, 2:54pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/5 "2014-04-13T14:54:44Z")

</div>

If I do that, and there are concurrent threads doing the same thing, is there impact to threads that are simply searching? I don't mind the indexing threads being slow, but i don't want to impact the search threads too much.

thanks  
ed

On Apr 13, 2014, at 10:47 AM, [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:

> Look at IndexRequestBuilder, there is a method setRefresh(true) so you can enforce a post refresh per index request.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe](https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [April 13, 2014, 3:34pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/6 "2014-04-13T15:34:19Z")

</div>

There is massive impact - but try and see for yourself.

Jörg

On Sun, Apr 13, 2014 at 4:54 PM, Edward Chin [echin1999@gmail.com](mailto:echin1999@gmail.com) wrote:

> If I do that, and there are concurrent threads doing the same thing, is  
> there impact to threads that are simply searching? I don't mind the  
> indexing threads being slow, but i don't want to impact the search threads  
> too much.
> 
> thanks  
> ed
> 
> On Apr 13, 2014, at 10:47 AM, [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:
> 
> Look at IndexRequestBuilder, there is a method setRefresh(true) so you can  
> enforce a post refresh per index request.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe](https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com)[https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com)[https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoHeCXQX\_NJfab4Wb00JFi8pPRf8GmpX8xnfuVym4yckMQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHeCXQX_NJfab4Wb00JFi8pPRf8GmpX8xnfuVym4yckMQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![mansishah](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mansishah](https://discuss.elastic.co/u/mansishah)
#### Post date: [December 4, 2014, 7:38pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/7 "2014-12-04T19:38:30Z")

</div>

I have a related question about synchronous behavior of Java APIs. I  
understand refresh will make sure that the indexed document becomes  
searchable but what about subsequent updates / deletes to the same document.

If I index a document and it is going to be done asynchronously does that  
mean an immediate update or delete on this document could potentially fail  
because the document is not yet actually saved? Note that the update/  
delete could be coming from potentially different client but still  
serially.

Is there a API like "flush" which guarantees that everything that has been  
indexed so far is now available in ES (not for search but for  
get/update/delete) at least in the trans log.

On Sunday, April 13, 2014 8:34:19 AM UTC-7, Jörg Prante wrote:

> There is massive impact - but try and see for yourself.
> 
> Jörg
> 
> On Sun, Apr 13, 2014 at 4:54 PM, Edward Chin \<[echi...@gmail.com](mailto:echi...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > If I do that, and there are concurrent threads doing the same thing, is  
> > there impact to threads that are simply searching? I don't mind the  
> > indexing threads being slow, but i don't want to impact the search threads  
> > too much.
> > 
> > thanks  
> > ed
> > 
> > On Apr 13, 2014, at 10:47 AM, [joerg...@gmail.com](mailto:joerg...@gmail.com) \<javascript:\> wrote:
> > 
> > Look at IndexRequestBuilder, there is a method setRefresh(true) so you  
> > can enforce a post refresh per index request.
> > 
> > Jörg
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe](https://groups.google.com/d/topic/elasticsearch/DWN30UYzeN4/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [December 5, 2014, 7:25pm UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/8 "2014-12-05T19:25:05Z")

</div>

Updates/deletes go to primary shard first, it is not possible that they can  
fail for one client. Another thing is bulk request action order. ES does  
not reorder or sort actions, this is up to the client.

Jörg  
Am 04.12.2014 20:38 schrieb [mansishah@maprtech.com](mailto:mansishah@maprtech.com):

> I have a related question about synchronous behavior of Java APIs. I  
> understand refresh will make sure that the indexed document becomes  
> searchable but what about subsequent updates / deletes to the same document.
> 
> If I index a document and it is going to be done asynchronously does that  
> mean an immediate update or delete on this document could potentially fail  
> because the document is not yet actually saved? Note that the update/  
> delete could be coming from potentially different client but still  
> serially.
> 
> Is there a API like "flush" which guarantees that everything that has been  
> indexed so far is now available in ES (not for search but for  
> get/update/delete) at least in the trans log.
> 
> On Sunday, April 13, 2014 8:34:19 AM UTC-7, Jörg Prante wrote:
> 
> > There is massive impact - but try and see for yourself.
> > 
> > Jörg
> > 
> > On Sun, Apr 13, 2014 at 4:54 PM, Edward Chin [echi...@gmail.com](mailto:echi...@gmail.com) wrote:
> > 
> > > If I do that, and there are concurrent threads doing the same thing, is  
> > > there impact to threads that are simply searching? I don't mind the  
> > > indexing threads being slow, but i don't want to impact the search threads  
> > > too much.
> > > 
> > > thanks  
> > > ed
> > > 
> > > On Apr 13, 2014, at 10:47 AM, [joerg...@gmail.com](mailto:joerg...@gmail.com) wrote:
> > > 
> > > Look at IndexRequestBuilder, there is a method setRefresh(true) so you  
> > > can enforce a post refresh per index request.
> > > 
> > > Jörg
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > topic/elasticsearch/DWN30UYzeN4/unsubscribe.  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_  
> > > KHffA%[40mail.gmail.com](http://40mail.gmail.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC\_fQTtedO%2B6EeS0iyL\_KHffA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHJay-pvs%3D4QoOyfYs%3DZkC_fQTtedO%2B6EeS0iyL_KHffA%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%[40gmail.com](http://40gmail.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/5F90E219-EAF2-41AA-848D-99D27CB0952F%40gmail.com?utm_medium=email&utm_source=footer)  
> > > .
> > > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f143fb0f-625f-4965-8416-346017080b0c%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAKdsXoFJN%3DocBc%2B9gV6wzi2v94C5kKYAcAmTMQ%2BZe2MyW79Q9Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFJN%3DocBc%2B9gV6wzi2v94C5kKYAcAmTMQ%2BZe2MyW79Q9Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:45am UTC](https://discuss.elastic.co/t/java-api-synchronous-vs-asynchronous/16985/9 "2017-07-06T00:45:27Z")

</div>


