Hi Elastic Users,
We have 6 shards 2 replicas(3 nodes). While am searching in node1 it gave one result, then pass the query to node2 & 3 it gave different order.
I tried preference = _primary & _primary_first It will returns correct order in all the nodes.
But I tried preference = userId(003fdaa6-c5e7-4578-a70e-1c010d358960). This will also returns the first results(Inconsistent results).
Could you please help me how to resolve the issue.
Hi All
Plz give suggestion for this post. Any configuration need to be change in my yml file.
Note: I did not changed anything in yml file. Am using elastic1.3.1
Is the number of hits the same every time? And are those documents have the same score?
If so, the behavior is expected. Elasticsearch (Lucene) uses Lucene's internal document ID when score is the same.
You can supply secondary sort criterion like "_uid" to make order consistent.
Hi All
Plz give suggestion for this post. Any configuration need to be change in
my yml file.
Note: I did not changed in anything in yml file. Am using elastic1.3.1
Is the number of hits the same every time? yes
And are those documents have the same score? no node by node it have different score
If I will try preference= _primary & _primary_first same score in all nodes.
But the above link told same shards hits while preference = sessionId or userId
I think this only not happen.
In that case, difference in score may be due to shard(or segment) state in each node (some shard still have deleted document in segments and others not).
It's noticeable when number of documents is relatively small.
If you'd like consistent result, you can use preference parameter. As long as you use the same preference, queries should hit the same set of shards.
Are you saying preference doesn't work like that?
If you add "explain":true to the query, you'll see which node and shard each document comes from.
Is the number of hits the same every time? yes
And are those documents have the same score? no node by node it have different score
If I will try preference= _primary & _primary_first same score in all
nodes.
But the above link told same shards hits while preference = sessionId or
userId
I think this only not happen.
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.