# Approximate kNN total hits inconsistent

**URL:** <https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [October 18, 2022, 1:32pm UTC](https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901 "2022-10-18T13:32:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dazhi\_Jiao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dazhi_jiao/32/111760_2.png) [@Dazhi\_Jiao](https://discuss.elastic.co/u/Dazhi_Jiao)\
**Post date:** [October 18, 2022, 1:32pm UTC](https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901/1 "2022-10-18T13:32:05Z")

</div>

Hi, we have an implementation of Approximate kNN search, with 768-dimension embedding vector in the ANN search. We observed that the total hits are not consistent when running the SAME query multiple times, or paginate using from and size. Sometimes the hits/total could vary by 100s when the total is thousands. We use k=100 and there are 5 shards. Any idea to make the total not changing?

---

<div class="post-metadata">

**Author:** ![Julie\_Tibshirani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/julie_tibshirani/32/55628_2.png) [@Julie\_Tibshirani](https://discuss.elastic.co/u/Julie_Tibshirani)\
**Post date:** [October 25, 2022, 10:55pm UTC](https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901/2 "2022-10-25T22:55:06Z")

</div>

Hi @Dazhi_Jiao , that is surprising! To help us debug, could you please send the API request you're using, as well as some information on the dataset?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 26, 2022, 5:12am UTC](https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901/3 "2022-10-26T05:12:37Z")

</div>

It is also always a good idea to specify which version of Elasticsearch you are using.

---

<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:** [November 23, 2022, 5:13am UTC](https://discuss.elastic.co/t/approximate-knn-total-hits-inconsistent/316901/4 "2022-11-23T05:13:11Z")

</div>

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