# Elasticsearch 2.3.3 : Same Query Yielding different Results with replica

**URL:** <https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218>\
**Category:** Elasticsearch\
**Created:** [October 17, 2016, 7:01pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218 "2016-10-17T19:01:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pradeep\_B](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Pradeep\_B](https://discuss.elastic.co/u/Pradeep_B)\
**Post date:** [October 17, 2016, 7:01pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/1 "2016-10-17T19:01:56Z")

</div>

Hi,  
I have seen lot of open topics in the forum which talk about the same issue but do not have a solution identified.

We have an index of about 300 million documents (500 GB disk space, 1 TB with replica) spread across 10 machines. What we observed is that a same bool query returns different results when we run the query multiple times from sense.  
The top scoring document is impacted because of this inconsistency. Ex: the top score doc for a inquiry has a score of 100 and resides in shard 10. the query returns a doc with a score of 80 from shard 6 .the results completely removing shard 10 from its results (top 20) .

All the machines are identical and \_cat/shards yields that all primary and replica's are in sync with exact count.  
What is causing this issue ? is this a bug in 2.3.3 ?  
We have tried to create a dedicated master node and inserting a sort criteria by \_score in the query, but nothing solved the issue.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 17, 2016, 8:20pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/2 "2016-10-17T20:20:33Z")

</div>

Did you try the DFS option? See [https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-search-type.html#dfs-query-then-fetch](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-request-search-type.html#dfs-query-then-fetch)

---

<div class="post-metadata">

**Author:** ![Pradeep\_B](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Pradeep\_B](https://discuss.elastic.co/u/Pradeep_B)\
**Post date:** [October 17, 2016, 9:21pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/3 "2016-10-17T21:21:13Z")

</div>

yes. my original query spans multiple indexes. the DFS query is not supported on multiple indexes, so i changed the query to point to 1 index and used DFS query, but the results are still changing.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 18, 2016, 6:05am UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/4 "2016-10-18T06:05:21Z")

</div>

May be you can use routing for your use case so you make sure that all related data are going to the same shard?

---

<div class="post-metadata">

**Author:** ![Pradeep\_B](https://avatars.discourse-cdn.com/v4/letter/p/f04885/32.png) [@Pradeep\_B](https://discuss.elastic.co/u/Pradeep_B)\
**Post date:** [October 18, 2016, 2:41pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/5 "2016-10-18T14:41:12Z")

</div>

could you tell me little bit more about the solution ? Even if i route all my so called "related" records to a single shard, the fact that some shards are not participating in the scoring process could mean i might not see the relevant shard.  
During my queries the top score varies a lot, in one of the executions i get a score of 560 for the top score but on the second run the top score comes from a different document and drops down to 480.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:11pm UTC](https://discuss.elastic.co/t/elasticsearch-2-3-3-same-query-yielding-different-results-with-replica/63218/6 "2017-07-05T22:11:32Z")

</div>


