# Different results because of replicas

**URL:** <https://discuss.elastic.co/t/different-results-because-of-replicas/201256>\
**Category:** Elasticsearch\
**Created:** [September 26, 2019, 2:40pm UTC](https://discuss.elastic.co/t/different-results-because-of-replicas/201256 "2019-09-26T14:40:23Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [September 27, 2019, 8:31am UTC](https://discuss.elastic.co/t/different-results-because-of-replicas/201256/8 "2019-09-27T08:31:32Z")

</div>

> [@Ewoks](#):
>
> Can you recommend me some resources to learn more about this so I can make better decisions in future?

Here you go:

- This [old article](https://www.elastic.co/blog/understanding-query-then-fetch-vs-dfs-query-then-fetch) has some background to the [DFS](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-request-body.html#request-body-search-search-type) search mode. That feature is designed to overcome any scoring bias across _different_ shards. However it won't help you solve your problem which is scoring differences between _replicas of the same shard_.

- For a detailed discussion on what might be the pros and cons of segment based replication (copying indexed docs not raw docs) then see [this thread](https://discuss.elastic.co/t/a-new-replication-type-physical-replication/157296/3)

- As you've already discovered, the `preference` parameter can help route users to the same choice of replica to try and give some stability (but ongoing indexing will carry on changing order).

- For a deep dive on the data structures in the indexes see [this talk](https://berlinbuzzwords.de/15/session/algorithms-and-data-structures-power-lucene-and-elasticsearch)

- Mike McCandless's [animation of Lucene segment merging].  
([Changing Bits: Visualizing Lucene's segment merges](http://blog.mikemccandless.com/2011/02/visualizing-lucenes-segment-merges.html)) is an interesting insight.

All-in-all distributed search on an actively changing dataset is challenging and requires a number of trade-offs.

---

_[View the full topic](https://discuss.elastic.co/t/different-results-because-of-replicas/201256)._
