# There is a phenomenon in which the results change when searching for Knn

**URL:** https://discuss.elastic.co/t/there-is-a-phenomenon-in-which-the-results-change-when-searching-for-knn/360322
**Category:** Elastic Search
**Created:** [May 27, 2024, 11:49pm UTC](https://discuss.elastic.co/t/there-is-a-phenomenon-in-which-the-results-change-when-searching-for-knn/360322 "2024-05-27T23:49:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bbasosuho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bbasosuho/32/123999_2.png) [@bbasosuho](https://discuss.elastic.co/u/bbasosuho)
#### Post date: [May 27, 2024, 11:49pm UTC](https://discuss.elastic.co/t/there-is-a-phenomenon-in-which-the-results-change-when-searching-for-knn/360322/1 "2024-05-27T23:49:35Z")

</div>

Hi  
I'm currently using knn search.  
There is a phenomenon in which the results change when searching for Knn. Is this a normal phenomenon?  
I know that knn searches may not yield 100% accurate answers. But I wonder if it is true that there are cases where the results change.  
Thanks

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [May 28, 2024, 12:22pm UTC](https://discuss.elastic.co/t/there-is-a-phenomenon-in-which-the-results-change-when-searching-for-knn/360322/2 "2024-05-28T12:22:25Z")

</div>

Hi @bbasosuho,

Without additional details, I suspect that you have multiple replicas that are returning different results, indicating that the HNSW graphs themselves are different on those replicas. It is expected that the HNSW graphs for replicas may differ because we don't do segment based replication and thus the graphs are re-created on each replica.

If you want to ensure consistent results for a user, you can use `preference` for routing users to consistently use the same shard, as described in [getting consistent scoring](https://www.elastic.co/guide/en/elasticsearch/reference/current/consistent-scoring.html#_scores_are_not_reproducible).

---

<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: [June 25, 2024, 12:23pm UTC](https://discuss.elastic.co/t/there-is-a-phenomenon-in-which-the-results-change-when-searching-for-knn/360322/3 "2024-06-25T12:23:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
