Inconsistent results (Preference = Custom (string) UserId)

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

Hi,

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.

Masaru
On March 27, 2015 at 20:15:43, andavar (andavar_laxman@rediffmail.com) wrote:

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

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Inconsistent-results-Preference-Custom-string-UserId-tp4072415p4072704.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1427454937397-4072704.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.5518e515.66ef438d.166%40citra-2.local.
For more options, visit https://groups.google.com/d/optout.

Thanks for reply Masaru.

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.

http://www.elastic.co/guide/en/elasticsearch/reference/1.3/search-request-preference.html
But the above link told same shards hits while preference = sessionId or userId
I think this only not happen.

Plz suggest any settings need to be change.

no node by node it have different score

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.

Masaru
On March 30, 2015 at 17:18:22, andavar (andavar_laxman@rediffmail.com) wrote:

Thanks for reply Masaru.

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.

http://www.elastic.co/guide/en/elasticsearch/reference/1.3/search-request-preference.html
But the above link told same shards hits while preference = sessionId or
userId
I think this only not happen.

Plz suggest any settings need to be change.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Inconsistent-results-Preference-Custom-string-UserId-tp4072415p4072816.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1427703494305-4072816.post%40n3.nabble.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/etPan.551a02f6.643c9869.3b55%40citra-2.local.
For more options, visit https://groups.google.com/d/optout.