# Can we use Approximate kNN algorithm other than Hierarchical Navigable Small World Algorithm?

**URL:** <https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [May 16, 2023, 7:01am UTC](https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533 "2023-05-16T07:01:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hikarut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hikarut/32/121064_2.png) [@hikarut](https://discuss.elastic.co/u/hikarut)\
**Post date:** [May 16, 2023, 7:01am UTC](https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533/1 "2023-05-16T07:01:25Z")

</div>

Hi All,

We have to construct a search system which contains 30 millions+ dense vectors.  
However, Naive kNN algorithm can not be applied to this scale of data.  
And, Hierarchical Navigable Small World Algorithm, which explicitly mentioned as a Approximate k-NN algorithm in a document, is also needs very large memory space.  
Therefore, we hope to utilize a Product Quantization Algorithm or other methods for this purpose.

Anyone have any idea?

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [May 18, 2023, 9:51pm UTC](https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533/2 "2023-05-18T21:51:27Z")

</div>

Hello Hiraku,  
Currently Elasticsearch supports only precise kNN or HNSW algorithm, product quantization is not supported. But you are welcome submit an issue for request either in Elasticsearch github or Lucene (the library underneath Elasticsearch).

---

<div class="post-metadata">

**Author:** ![hikarut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hikarut/32/121064_2.png) [@hikarut](https://discuss.elastic.co/u/hikarut)\
**Post date:** [May 30, 2023, 9:48am UTC](https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533/3 "2023-05-30T09:48:15Z")

</div>

Thank you for your reply!

---

<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 27, 2023, 9:48am UTC](https://discuss.elastic.co/t/can-we-use-approximate-knn-algorithm-other-than-hierarchical-navigable-small-world-algorithm/333533/4 "2023-06-27T09:48:28Z")

</div>

Closed on June 27, 2023, 9:48am UTC

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