# k-NN

**URL:** https://forum.opensearch.org/c/plugins/k-nn/48.md

[Latest](https://forum.opensearch.org/latest.md) · [Categories](https://forum.opensearch.org/categories.md) · [Tags](https://forum.opensearch.org/tags.md)

---

## [About the k-NN category](https://forum.opensearch.org/t/about-the-k-nn-category/2187)

<div class="topic-metadata">

**Author:** [@stevliu](https://forum.opensearch.org/u/stevliu)\
**Replies:** 0\
**Last updated:** [February 11, 2020, 5:30am UTC](https://forum.opensearch.org/t/about-the-k-nn-category/2187 "2020-02-11T05:30:21Z")

</div>

Discussion area for the k-NN plugin, which enables users to search for the k-nearest neighbors to a query point across an index of vectors.

---

## [Reindexing the same index again is giving different counts for neural search](https://forum.opensearch.org/t/reindexing-the-same-index-again-is-giving-different-counts-for-neural-search/28316)

<div class="topic-metadata">

**Author:** [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Replies:** 4\
**Last updated:** [October 7, 2026, 4:34pm UTC](https://forum.opensearch.org/t/reindexing-the-same-index-again-is-giving-different-counts-for-neural-search/28316 "2026-10-07T16:34:52Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 3.2.0 Describe the issue: If we reindex a document with vector fields with no change in data or the embedding model. Then use same search query…

---

## [Integer Overflow occurs when building a large-scale vector index](https://forum.opensearch.org/t/integer-overflow-occurs-when-building-a-large-scale-vector-index/27818)

<div class="topic-metadata">

**Author:** [@Maihj](https://forum.opensearch.org/u/Maihj)\
**Replies:** 4\
**Last updated:** [February 9, 2026, 8:36pm UTC](https://forum.opensearch.org/t/integer-overflow-occurs-when-building-a-large-scale-vector-index/27818 "2026-02-09T20:36:51Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 3.3.2 Describe the issue: I built a vector index (faiss engine, HNSW + BQ, 1024 dimension per vector) with memory\_optimized\_search enabled (tota…

---

## [KNN Derived Source and on\_disk vectors - Expectations](https://forum.opensearch.org/t/knn-derived-source-and-on-disk-vectors-expectations/27423)

<div class="topic-metadata">

**Author:** [@jakob\_b](https://forum.opensearch.org/u/jakob_b)\
**Replies:** 9\
**Last updated:** [November 28, 2025, 12:49am UTC](https://forum.opensearch.org/t/knn-derived-source-and-on-disk-vectors-expectations/27423 "2025-11-28T00:49:03Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): Opensearch 3.1, local docker image. Describe the issue: Creating an index with “index.knn.derived\_source.enabled":true does not seem to yeild any storage …

---

## [Opensearch K-NN semantic search issue with Nested JSON data](https://forum.opensearch.org/t/opensearch-k-nn-semantic-search-issue-with-nested-json-data/27502)

<div class="topic-metadata">

**Author:** [@bimlesh\_singh](https://forum.opensearch.org/u/bimlesh_singh)\
**Replies:** 1\
**Last updated:** [November 19, 2025, 12:07pm UTC](https://forum.opensearch.org/t/opensearch-k-nn-semantic-search-issue-with-nested-json-data/27502 "2025-11-19T12:07:48Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.19.3 Describe the issue: Opensearch K-NN semantic search issue Configuration: We are enabling K-NN plugin for sematic search with model and followed the …

---

## [Supporting Late Interaction in OpenSearch Vector Engine as a Field Type](https://forum.opensearch.org/t/supporting-late-interaction-in-opensearch-vector-engine-as-a-field-type/27463)

<div class="topic-metadata">

**Author:** [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Replies:** 0\
**Last updated:** [November 10, 2025, 11:32pm UTC](https://forum.opensearch.org/t/supporting-late-interaction-in-opensearch-vector-engine-as-a-field-type/27463 "2025-11-10T23:32:46Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 3.4 and above Describe the issue: OpenSearch recently added support for rescoring with late interaction models using painless script scoring. Meanwhile, Lu…

---

## [Semantic search inner\_hits](https://forum.opensearch.org/t/semantic-search-inner-hits/27340)

<div class="topic-metadata">

**Author:** [@faileon](https://forum.opensearch.org/u/faileon)\
**Replies:** 1\
**Last updated:** [October 22, 2025, 11:34am UTC](https://forum.opensearch.org/t/semantic-search-inner-hits/27340 "2025-10-22T11:34:01Z")

</div>

Versions v 3.1.0 When I run pure semantic search with dense vectors via neural query and with nested documents, the inner\_hits only contain one result. Example: GET my\_index/\_search { "query": { "nested": { …

---

## [Unable to register pretrained model 2.19.1](https://forum.opensearch.org/t/unable-to-register-pretrained-model-2-19-1/27104)

<div class="topic-metadata">

**Author:** [@OMOS](https://forum.opensearch.org/u/OMOS)\
**Replies:** 3\
**Last updated:** [September 24, 2025, 7:45pm UTC](https://forum.opensearch.org/t/unable-to-register-pretrained-model-2-19-1/27104 "2025-09-24T19:45:31Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): Describe the issue: Registering any of the pre-trained models is failing with a connection timed out exception Configuration: Relevant Logs or Screenshots: …

---

## [Opensearchknn\_faiss\_avx2.so are not delivered as part of 2.19.x opensearch](https://forum.opensearch.org/t/opensearchknn-faiss-avx2-so-are-not-delivered-as-part-of-2-19-x-opensearch/26633)

<div class="topic-metadata">

**Author:** [@Maha](https://forum.opensearch.org/u/Maha)\
**Replies:** 1\
**Last updated:** [September 18, 2025, 8:19am UTC](https://forum.opensearch.org/t/opensearchknn-faiss-avx2-so-are-not-delivered-as-part-of-2-19-x-opensearch/26633 "2025-09-18T08:19:05Z")

</div>

Versions (relevant - OpenSearch Plugin): 2.19.x Describe the issue: opensearchknn\_faiss\_avx2.so is not delivered as part of 2.19.x series, some environments expect .avx2 files instead of faiss.so files. Hence, the bas…

---

## [Knn.derived\_source=true causes query not to return \_routing](https://forum.opensearch.org/t/knn-derived-source-true-causes-query-not-to-return-routing/26137)

<div class="topic-metadata">

**Author:** [@asfoorial](https://forum.opensearch.org/u/asfoorial)\
**Replies:** 3\
**Last updated:** [August 17, 2025, 10:39am UTC](https://forum.opensearch.org/t/knn-derived-source-true-causes-query-not-to-return-routing/26137 "2025-08-17T10:39:54Z")

</div>

Hi all, I noticed that knn.derived\_source=true causes search requests to return without \_routing! Is that an expected behaviour? More specifically it happens after creating a semantic field and populating it with conte…

---

## [Optimize K value with K-Elbow algorithm in K-NN search](https://forum.opensearch.org/t/optimize-k-value-with-k-elbow-algorithm-in-k-nn-search/26347)

<div class="topic-metadata">

**Author:** [@eric.bui](https://forum.opensearch.org/u/eric.bui)\
**Replies:** 0\
**Last updated:** [August 14, 2025, 1:42am UTC](https://forum.opensearch.org/t/optimize-k-value-with-k-elbow-algorithm-in-k-nn-search/26347 "2025-08-14T01:42:41Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): latest Describe the issue: Should we use K-elbow algorithm by ourselves to find the most optimal value of param K in KNN or semantic search? Configuration: …

---

## [1536 dims vector search issue on v2.14](https://forum.opensearch.org/t/1536-dims-vector-search-issue-on-v2-14/26288)

<div class="topic-metadata">

**Author:** [@ji99999](https://forum.opensearch.org/u/ji99999)\
**Replies:** 3\
**Last updated:** [August 8, 2025, 7:20pm UTC](https://forum.opensearch.org/t/1536-dims-vector-search-issue-on-v2-14/26288 "2025-08-08T19:20:15Z")

</div>

Hello everyone. I’ve encountered an issue while using OpenSearch and I’m posting here for help. Thank you in advance for your reply. Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch: 2.14 Descr…

---

## [Performance of OpenSearch K-NN Search with Additional Filters (e.g., Metadata Conditions)](https://forum.opensearch.org/t/performance-of-opensearch-k-nn-search-with-additional-filters-e-g-metadata-conditions/25589)

<div class="topic-metadata">

**Author:** [@bhuvan](https://forum.opensearch.org/u/bhuvan)\
**Replies:** 0\
**Last updated:** [July 6, 2025, 6:15pm UTC](https://forum.opensearch.org/t/performance-of-opensearch-k-nn-search-with-additional-filters-e-g-metadata-conditions/25589 "2025-07-06T18:15:26Z")

</div>

I came across this AWS blog on OpenSearch K-NN — very helpful! I’m exploring K-NN queries with filters (e.g., status = 'active') and wondering about performance implications. In pgvector, there’s an “iterative inde…

---

## [OpenSearch 3.0 : unknown setting \[index.knn.space\_type\] please check that any required plugins are installed, or check the breaking changes documentation for removed settings](https://forum.opensearch.org/t/opensearch-3-0-unknown-setting-index-knn-space-type-please-check-that-any-required-plugins-are-installed-or-check-the-breaking-changes-documentation-for-removed-settings/24319)

<div class="topic-metadata">

**Author:** [@sans\_india85](https://forum.opensearch.org/u/sans_india85)\
**Replies:** 4\
**Last updated:** [May 13, 2025, 3:43pm UTC](https://forum.opensearch.org/t/opensearch-3-0-unknown-setting-index-knn-space-type-please-check-that-any-required-plugins-are-installed-or-check-the-breaking-changes-documentation-for-removed-settings/24319 "2025-05-13T15:43:57Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): C:\\opensearch-3.0.0-windows-x64\\opensearch-3.0.0 Describe the issue: RAG chatbot with a conversational flow agent - OpenSearch Documentation \<–On creation …

---

## [Hybrid Search not working with Document Level Security](https://forum.opensearch.org/t/hybrid-search-not-working-with-document-level-security/24239)

<div class="topic-metadata">

**Author:** [@PaulCampbell](https://forum.opensearch.org/u/PaulCampbell)\
**Replies:** 4\
**Last updated:** [April 30, 2025, 4:41pm UTC](https://forum.opensearch.org/t/hybrid-search-not-working-with-document-level-security/24239 "2025-04-30T16:41:50Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.17.1 2.19.1 Describe the issue: Hybrid search queries fail when authenticating with a user that has Document Level Security enabled. GET my\_test\_ind…

---

## [Error when deploying pretrained model: Unknown builtin op: aten::scaled\_dot\_product\_attention](https://forum.opensearch.org/t/error-when-deploying-pretrained-model-unknown-builtin-op-aten-scaled-dot-product-attention/24040)

<div class="topic-metadata">

**Author:** [@drjz](https://forum.opensearch.org/u/drjz)\
**Replies:** 3\
**Last updated:** [April 15, 2025, 2:34am UTC](https://forum.opensearch.org/t/error-when-deploying-pretrained-model-unknown-builtin-op-aten-scaled-dot-product-attention/24040 "2025-04-15T02:34:13Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.17.1 Describe the issue: I am trying to load a pretrained model into OpenSearch. But I am getting this error: Unknown builtin op: aten::scaled\_dot\_produ…

---

## [Is There a GitHub Issue Tracking the "Upgrade to opensearch 2.17.1 blocked because index.knn is set to false"?](https://forum.opensearch.org/t/is-there-a-github-issue-tracking-the-upgrade-to-opensearch-2-17-1-blocked-because-index-knn-is-set-to-false/23927)

<div class="topic-metadata">

**Author:** [@rahulkr](https://forum.opensearch.org/u/rahulkr)\
**Replies:** 3\
**Last updated:** [March 25, 2025, 7:20pm UTC](https://forum.opensearch.org/t/is-there-a-github-issue-tracking-the-upgrade-to-opensearch-2-17-1-blocked-because-index-knn-is-set-to-false/23927 "2025-03-25T19:20:52Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch: 2.17.1 Running in GKE Describe the issue: The issue discussed in this forum thread was automatically closed due to inactivity. I wanted to che…

---

## [Why opensearchpy doesn't support knn since knn was added for a long time，but in ES8.x python sdk supports it](https://forum.opensearch.org/t/why-opensearchpy-doesnt-support-knn-since-knn-was-added-for-a-long-time-but-in-es8-x-python-sdk-supports-it/23582)

<div class="topic-metadata">

**Author:** [@pyyuhao](https://forum.opensearch.org/u/pyyuhao)\
**Replies:** 2\
**Last updated:** [February 28, 2025, 2:21am UTC](https://forum.opensearch.org/t/why-opensearchpy-doesnt-support-knn-since-knn-was-added-for-a-long-time-but-in-es8-x-python-sdk-supports-it/23582 "2025-02-28T02:21:31Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.18 opensearchpy==2.7.1 Describe the issue: Why opensearchpy doesn’t support knn since knn was added for a long time，but in ES8.x python sdk s…

---

## [Reducing the Disk space of Indexes for Vector embeddings through pretrained models](https://forum.opensearch.org/t/reducing-the-disk-space-of-indexes-for-vector-embeddings-through-pretrained-models/23362)

<div class="topic-metadata">

**Author:** [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Replies:** 5\
**Last updated:** [February 17, 2025, 4:53am UTC](https://forum.opensearch.org/t/reducing-the-disk-space-of-indexes-for-vector-embeddings-through-pretrained-models/23362 "2025-02-17T04:53:37Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.18 Describe the issue: I wanted to know if there is a way to reduce the on-disk storage of Vector embeddings by converting them to byte/16 bit…

---

## [Poor search quality over semantically equivalent searches](https://forum.opensearch.org/t/poor-search-quality-over-semantically-equivalent-searches/23388)

<div class="topic-metadata">

**Author:** [@ehsankf](https://forum.opensearch.org/u/ehsankf)\
**Replies:** 0\
**Last updated:** [February 12, 2025, 6:18pm UTC](https://forum.opensearch.org/t/poor-search-quality-over-semantically-equivalent-searches/23388 "2025-02-12T18:18:40Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.17 Describe the issue: The hybrid search query returns significantly different results for searches which are semantically identical. Configuration: R…

---

## [Further Discussion from the issue written by @jdomkline](https://forum.opensearch.org/t/further-discussion-from-the-issue-written-by-jdomkline/23321)

<div class="topic-metadata">

**Author:** [@yeonghyeonKo](https://forum.opensearch.org/u/yeonghyeonKo)\
**Replies:** 1\
**Last updated:** [February 5, 2025, 5:19am UTC](https://forum.opensearch.org/t/further-discussion-from-the-issue-written-by-jdomkline/23321 "2025-02-05T05:19:26Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.15 Describe the issue: Since the original issue is closed and it no longer accepts new replies, I write this topic. Failed to deploy model 0UZj05QBIjm…

---

## [Approximate k-NN with pre-filter](https://forum.opensearch.org/t/approximate-k-nn-with-pre-filter/4494)

<div class="topic-metadata">

**Author:** [@jojo](https://forum.opensearch.org/u/jojo)\
**Replies:** 6\
**Last updated:** [January 30, 2025, 5:32am UTC](https://forum.opensearch.org/t/approximate-k-nn-with-pre-filter/4494 "2025-01-30T05:32:19Z")

</div>

Hello Team, Is it possible to use a pre-filter (on a keyword field for example) and then do approximate k-NN on the remaining documents so that I always get back exactly k documents? The documentation mentions a pre-fil…

---

## [\[BUG\] Insufficient number of hits for nested knn queries with efficient filter #2347](https://forum.opensearch.org/t/bug-insufficient-number-of-hits-for-nested-knn-queries-with-efficient-filter-2347/22867)

<div class="topic-metadata">

**Author:** [@corentin](https://forum.opensearch.org/u/corentin)\
**Replies:** 2\
**Last updated:** [December 20, 2024, 5:17pm UTC](https://forum.opensearch.org/t/bug-insufficient-number-of-hits-for-nested-knn-queries-with-efficient-filter-2347/22867 "2024-12-20T17:17:03Z")

</div>

Hello :wave: What is the bug? We use an index to store text documents for semantic search purpose. The text being long, we chunk it in paragraph to embed it using all-MiniLM-L6-v2 model. Each chunk being stored in that…

---

## [Dynamic method \[org.opensearch.knn.index.KNNVectorScriptDocValues.KNNNativeVectorScriptDocValues, getValue/0\] not found](https://forum.opensearch.org/t/dynamic-method-org-opensearch-knn-index-knnvectorscriptdocvalues-knnnativevectorscriptdocvalues-getvalue-0-not-found/22581)

<div class="topic-metadata">

**Author:** [@asolodin](https://forum.opensearch.org/u/asolodin)\
**Replies:** 1\
**Last updated:** [December 13, 2024, 11:02pm UTC](https://forum.opensearch.org/t/dynamic-method-org-opensearch-knn-index-knnvectorscriptdocvalues-knnnativevectorscriptdocvalues-getvalue-0-not-found/22581 "2024-12-13T23:02:58Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): v 2.15.0 Describe the issue: We have a knn\_vector field which has double values. I would like to convert them to floats for retrieval (we use the vector va…

---

## [K-NN Resource Usage](https://forum.opensearch.org/t/k-nn-resource-usage/3417)

<div class="topic-metadata">

**Author:** [@dnock](https://forum.opensearch.org/u/dnock)\
**Replies:** 5\
**Last updated:** [December 13, 2024, 8:57am UTC](https://forum.opensearch.org/t/k-nn-resource-usage/3417 "2024-12-13T08:57:33Z")

</div>

Hey! I was wondering if there was guidance that could be provided with regards resource usage for elastic search clusters running this plugin. I’m interesting in exploring given N documents, M graph links, and vectors of…

---

## [Null\_pointer\_exception with Faiss byte vectors when filtering](https://forum.opensearch.org/t/null-pointer-exception-with-faiss-byte-vectors-when-filtering/22673)

<div class="topic-metadata">

**Author:** [@matt.haigh](https://forum.opensearch.org/u/matt.haigh)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 11:20pm UTC](https://forum.opensearch.org/t/null-pointer-exception-with-faiss-byte-vectors-when-filtering/22673 "2024-12-04T23:20:06Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.17.0 Describe the issue: I have been trying to use the faiss engine with byte vectors. I can successfully load the vectors into an index and s…

---

## [Where can I find total vector count per index?](https://forum.opensearch.org/t/where-can-i-find-total-vector-count-per-index/21801)

<div class="topic-metadata">

**Author:** [@spork](https://forum.opensearch.org/u/spork)\
**Replies:** 6\
**Last updated:** [November 30, 2024, 4:39pm UTC](https://forum.opensearch.org/t/where-can-i-find-total-vector-count-per-index/21801 "2024-11-30T16:39:24Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.13 AWS OpenSearch Describe the issue: I’d like to crunch some numbers to estimate memory usage for knn vectors (k-NN index - OpenSearch Documentation) Ho…

---

## [Question about ANN graph memory size](https://forum.opensearch.org/t/question-about-ann-graph-memory-size/21969)

<div class="topic-metadata">

**Author:** [@ken-ad](https://forum.opensearch.org/u/ken-ad)\
**Replies:** 3\
**Last updated:** [November 30, 2024, 4:41pm UTC](https://forum.opensearch.org/t/question-about-ann-graph-memory-size/21969 "2024-11-30T16:41:23Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.15 (AWS OpenSearch) Describe the issue: I’d like to double-check how ANN graph memory size works. I’ve found a few different equations for how much space…

---

## [How does \`osknnqstate\` file work for reducing memory when knn searching?](https://forum.opensearch.org/t/how-does-osknnqstate-file-work-for-reducing-memory-when-knn-searching/22585)

<div class="topic-metadata">

**Author:** [@yeonghyeonKo](https://forum.opensearch.org/u/yeonghyeonKo)\
**Replies:** 0\
**Last updated:** [November 27, 2024, 5:46am UTC](https://forum.opensearch.org/t/how-does-osknnqstate-file-work-for-reducing-memory-when-knn-searching/22585 "2024-11-27T05:46:28Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.17.1 Describe the issue: I’ve tested the advantages of quantization with two groups of indices: green open quantized.comment\_2021 U7GNCo1q…

---

## [What's the combination in normalization processor?](https://forum.opensearch.org/t/whats-the-combination-in-normalization-processor/22511)

<div class="topic-metadata">

**Author:** [@Garance](https://forum.opensearch.org/u/Garance)\
**Replies:** 0\
**Last updated:** [November 19, 2024, 5:19pm UTC](https://forum.opensearch.org/t/whats-the-combination-in-normalization-processor/22511 "2024-11-19T17:19:48Z")

</div>

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): OpenSearch 2.17 on AWS Describe the issue: Could someone explain in detail what is the combination in normalization processor? For our case we have an ind…

[Next page](https://forum.opensearch.org/c/plugins/k-nn/48.md?page=1)
