-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Support exact search in a better way #97541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pinging @elastic/es-search (Team:Search) |
Some edge cases here are:
|
Task Refinementcc @benwtrent and @mayya-sharipova for validation Questions
Implementation planIn case we do this before making knn search a query, these are the changes to the code that I've planned: Lucene
if (exact) {
Scorer scorer = filterWeight.scorer(ctx);
BitSet acceptDocs = createBitSet(scorer.iterator(), liveDocs, maxDoc);
return exactSearch(ctx, new BitSetIterator(acceptDocs, k));
}
Elasticsearch
|
After discussing with @benwtrent , we'll tackle this issue after #97940 |
This is no longer blocked - @liranabn for prioritisation. |
We need to consider the case when vectors are not in an HNSW graph at all (e.g. "index: false"). We need to allow kNN queries and top level kNN to work there as well IMO. This may require some configuration from the user to indicate the similarity they want to use. Possibly, we just require the similarity to be set in the mapping and if they want to use custom similarity functions, they must switch back to I wonder if we should allow |
Proposal:
This turns this issue into a doable action item that provides value to our users, and defers scoping of some of the edge case questions surrounding flat indices to outside the scope of this issue. |
From the above discussion, we will take the following steps for the scope of this work.
|
For the Lucene changes, we need a new public interface that all leaf readers can read. Assigning the issue to @benwtrent for the lucene work. Once the lucene work is done, search relevance team can take the elasticsearch work. |
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
Description
Currently the only way for users to do a brute-force or exact search with KNN is with a script query. This requires some knowledge of the function names and scoring methodologies.
We should provide a better interface for exact scan. One idea is to have an
exact: true
field withinkNN
.The name of the field is debatable. Or if we even update kNN at all. Maybe a new
kNN
query that allows for both exact and approximate within the query DSL?The text was updated successfully, but these errors were encountered: