I have a cluster with 2 data nodes, each node has one shard. When I make a query, I sort by a date field but I get inconsistent result if I perform the same query twice.
This is because (I think) ES hits the nodes in round-robin, and each node sorts the data slightly differently. Using preference: my_user_id
doesn't help because I already hit the only available shard every time, it looks like the data in the shard is not the same across nodes. In fact, if I always hit a single node using preference: "_prefer_nodes:orgKQBy5TyGcduyZ2MEVUw"
I get consistently sorted results.
How could I get a consistent sort without forcing my query on a specific node ? Aren't the shards identical across nodes ? Would the use of an additional tie-breaker sort help ?
thanks!