ElasticSearch cluster behavior - Define all nodes to update together


After I insert a document to ElasticSearch I immediately go and retrieve it with a query.
I am polling the request several times so if it isn't completely indexed it will return in the second or third try.

in a clustered environment, I have noticed that I can get the request and a milisecond later the same request is returned empty.

I assume that it goes to another node in the cluster - that is not yet indexed.

If this is it, I really need to define the cluster to return a value only after all nodes are updated with it.

  1. Was what I described true? Is it possible that not all nodes are updated together?
  2. Is it a cluster configuration issue ? Is it solvable with configuration?


You need to refresh the index. By default new data are available for searching only after 1s.

Note: don't do that in prod.

It seems weird to me.

Does anyone has a link that descibes this behaviour?
I would have expected the cluster to send index it, save it to all nodes and then return a similiar answer to all requests.