Does *ElasticSearch *ensure that after one makes an index request and sets refresh to true, the refresh is being completed by the time we get the response back or the refresh is done asynchronously and it is not guaranteed that refresh is completed by the time the response is sent back?
Sample code:
val request = new IndexRequest(indexName, typeName)
.refresh(true)
.id(someId)
.source(someJson.toString)
The "refresh" attribute in the index request controls the optional
execution of a (heavy) refresh operation after the document creation.
This is synchronous per shard but asynchronous per replica.
If you want to receive the API response after all replica shards have
completed the operation you must increase the write consistency to
WriteConsistencyLevel.ALL. This will wait for operation completion for
all nodes being involved until the timeout in the request given is exceeded.
Jörg
Am 24.05.13 17:12, schrieb Andrei Tolnai:
Hello.
Does *Elasticsearch *ensure that after one makes an index request and
sets refresh to true, the refresh is being completed by the time
we get the response back or the refresh is done asynchronously and it
is not guaranteedthat refresh is completed by the time the response is
sent back?
Sample code:
valrequest=newIndexRequest(indexName,typeName)
.refresh(true)
.id(someId)
.source(someJson.toString)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.