1

I have 3 elastic search nodes setup. I have defined the following settings

"number_of_shards" : "6", 
"number_of_replicas" : "1"

Every time I run the below query

GET na-products/elasticparentchildtitle/_search?explain
{
  "query": {
   "match_all": {}
   }
}

I get different results. I also see the node returning the results are different every time.

In a test environment, if I try the same index in single node machine, i get the same results.

robert
  • 181
  • 1
  • 6
  • See Andrei's answer for a similar post: http://stackoverflow.com/a/30402153/3326617 – eemp Jan 12 '16 at 18:32
  • 2
    As match_all returns all the documents, it might be possible you are getting same documents but in different order. – udit mittal Jan 12 '16 at 18:46
  • i have checked the first 10 records it is all different. – robert Jan 12 '16 at 19:47
  • 1
    Finally i got the answer. this is happening because when you do all search using "match_all", due to the same score, it may retrieve results from primary shard or sometime from replica shard and hence the mismatch. Setting the _preference=_primary in the search url solved the issue – robert Jan 15 '16 at 20:15
  • Possible duplicate of [What causes different search results for same elastic search query on two nodes](https://stackoverflow.com/questions/30402023/what-causes-different-search-results-for-same-elastic-search-query-on-two-nodes) – Sufiyan Ghori May 02 '18 at 00:01

0 Answers0