You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>NOTE: The kNN search API has been replaced by the <code>knn</code> option in the search API.</p>
3038
-
<p>Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents.
3039
-
Given a query vector, the API finds the k closest vectors and returns those documents as search hits.</p>
3040
-
<p>Elasticsearch uses the HNSW algorithm to support efficient kNN search.
3041
-
Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed.
3042
-
This means the results returned are not always the true k closest neighbors.</p>
3043
-
<p>The kNN search API supports restricting the search using a filter.
3044
-
The search will return the top k documents that also match the filter query.</p>
3045
-
<p>A kNN search response has the exact same structure as a search API response.
3046
-
However, certain sections have a meaning specific to kNN search:</p>
3047
-
<ul>
3048
-
<li>The document <code>_score</code> is determined by the similarity between the query and document vector.</li>
3049
-
<li>The <code>hits.total</code> object contains the total number of nearest neighbor candidates considered, which is <code>num_candidates * num_shards</code>. The <code>hits.total.relation</code> will always be <code>eq</code>, indicating an exact value.</li>
<p>NOTE: The kNN search API has been replaced by the <code>knn</code> option in the search API.</p>
3036
-
<p>Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents.
3037
-
Given a query vector, the API finds the k closest vectors and returns those documents as search hits.</p>
3038
-
<p>Elasticsearch uses the HNSW algorithm to support efficient kNN search.
3039
-
Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed.
3040
-
This means the results returned are not always the true k closest neighbors.</p>
3041
-
<p>The kNN search API supports restricting the search using a filter.
3042
-
The search will return the top k documents that also match the filter query.</p>
3043
-
<p>A kNN search response has the exact same structure as a search API response.
3044
-
However, certain sections have a meaning specific to kNN search:</p>
3045
-
<ul>
3046
-
<li>The document <code>_score</code> is determined by the similarity between the query and document vector.</li>
3047
-
<li>The <code>hits.total</code> object contains the total number of nearest neighbor candidates considered, which is <code>num_candidates * num_shards</code>. The <code>hits.total.relation</code> will always be <code>eq</code>, indicating an exact value.</li>
0 commit comments