-
Notifications
You must be signed in to change notification settings - Fork 132
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
[FEATURE] Providing better experience for doing Exact Search without Script Score Query #1079
Comments
I like it. Something like this?
then default |
@jmazanec15 this is inline to the thought I had when creating this issue. Do we see any other alternative here? I see one, which is creating a new query clause but thats not a good option. So I never added it. So lets stick to this one unless some one has any better ideas. |
On thinking over this more I think, what we can do is we can start taking another option which is used for text fields too. We can use this field Example:
We can then pass this set the value as an attribute in VectorField, and read this value in PerFieldCodec to hit a new plain codec that just stores the vectors. This approach will work for all the engines. cc: @vamshin , @jmazanec15 , @luyuncheng what your thought. |
I think that makes sense. So this would fall back to brute force knn search? |
Yes that is correct. |
@navneet1v do you think instead we can do "method": false? Right now, method specifies the structure for ANN search. So, if we set to false, it would make sense that we do not want to do ANN search. |
actually method false we can do but in Opensearch that way we define things are not indexed is by saying Another thing is method:false doesn't work with LegacyFieldMapper |
Got it. Then, I think we will need to ensure that method, model_id, and index:false, are all mutually exclusive |
Yes that is correct. See index: false govern that should we be creating vector data structures or not. It has that simple job. |
I am working on this. refer #2368 for detailed proposal.
Next followup of this could be disablement of scoring script but need to think more on that. |
Is your feature request related to a problem?
Currently if a user has to do exact search, they need to use script query to the exact search. Ref: https://opensearch.org/docs/latest/search-plugins/knn/knn-score-script/ This is not intuitive and uses an extra hop, which is script compilation. Given that scripts are notorious and posses security concerns running in OpenSearch in multi tenant environments.
What solution would you like?
Solution is to provide the exact search feature in the k-nn query clause itself. Given that k-NN vectors are stored as doc values in the segment, during query execution code can easily iterate over these doc values of the segment to do the exact search.
What alternatives have you considered?
NA
Do you have any additional context?
NA
Similar Issue: #1078
The text was updated successfully, but these errors were encountered: