ElasticSearch cluster behavior - Define all nodes to update together


(Mysurf Mail) #1

Hi,

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.

Sometimes,
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?

Thanks.


(David Pilato) #2

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

Note: don't do that in prod.


(Mysurf Mail) #3

Ok,
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.


(system) #4