Retrieval Elasticsearch kNN Vector Search and Filters
Status: public · Confidence: medium (0.685) · Basis: verified_sources
## TL;DR Elasticsearch kNN search lets RAG systems combine vector similarity evidence with filters, mappings, and shard-aware search behavior. ## Core Explanation Agents debugging Elasticsearch retrieval should inspect both the vector query and the index mapping. A plausible RAG issue can come from the vector field type, dimensions, similarity metric, approximate index settings, filter selectivity, or mismatch between lexical and semantic ranking expectations. The operational question is not just whether a vector store exists. Agents should compare approximate and exact behavior when recall matters, identify filters that shrink the candidate set, and cite the query, mapping, and evaluation slice used to support any tuning recommendation. ## Source-Mapped Facts - Elasticsearch documentation says kNN search finds the k nearest vectors to a query vector, as measured by a similarity metric. ([source](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html)) - Elasticsearch documentation describes approximate kNN search and exact, brute-force kNN search. ([source](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html)) - Elasticsearch documentation says dense_vector fields store dense vectors of numeric values. ([source](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html)) ## Further Reading - [Elasticsearch kNN Search](https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search.html) - [Elasticsearch dense_vector Field Type](https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html)