Skip to main content

One post tagged with "knn"

View All Tags

Vector Search in OpenSearch: Embeddings, k-NN Indexes, and HNSW

· 6 min read
FoundryDB Team
Engineering @ FoundryDB

Keyword search breaks when users phrase queries differently from the words in your documents. Vector search fixes this by comparing meaning rather than tokens. This post walks through registering a sentence embedding model, building a k-NN index with an ingest pipeline, and running semantic queries against a FoundryDB-managed OpenSearch 2.19.1 cluster. All scores and outputs are from a real test run.

All commands use YOUR_OPENSEARCH_HOST and YOUR_PASSWORD as placeholders. Replace them with your cluster domain and app_user password from the FoundryDB dashboard.

pgvector similarity search · query → HNSW → top-k
TOP-K vector → HNSW index → filter → nearest rows
Queryvector | textANN · HNSWcosine <=>AND filter →Top-kby distance
Query / top-kServer-side embedANN search · tableHNSW indexEquality filter (WHERE)index / predicate edge (dashed)