-
Notifications
You must be signed in to change notification settings - Fork 62
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
Update knn query spec #538
Conversation
Signed-off-by: Alex Keeler <[email protected]>
The change was a bit more involved than I had originally anticipated. |
Changes AnalysisCommit SHA: 7f5b7b8 API ChangesSummary
ReportThe full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/10615313001/artifacts/1869972004 API Coverage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec/schemas/_common.yaml
Outdated
num_candidates: | ||
description: The number of nearest neighbor candidates to consider per shard | ||
min_score: | ||
description: The minimum similarity score for a neighbor to be considered a hit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: add periods at the end of these descriptions.
Signed-off-by: Alex Keeler <[email protected]>
For lints, probably just easier to sort values.
Tests also need to be limited to |
Signed-off-by: Alex Keeler <[email protected]>
Looks like the filter query doesn't work in these old versions either. Not sure whether that's expected.
You can reproduce these failures locally pretty easily btw.
|
Thanks for the heads up, I've only been testing against 2.16.0 locally. I'll go through and make sure all is well with earlier releases. I'm sure the failures are as annoying for you as they are for me. |
@navneet1v from k-nn might be interested in this and can help make sure things are properly version-annotated |
The filter query specifically provided here doesn't work for old version because filters works for 2.4 and above. |
Signed-off-by: Alex Keeler <[email protected]>
Thank you for the info. I ended up restraining the filter test to >= 2.9, as it appears the faiss engine didn't get filter support until then. I tried switching the embedding to lucene, but found out that lucene knn support wasn't added until version 2.2, so I figured it was better to keep things as is. For extra safety, I also constrained the entire test to >= 1.2, which is when faiss k-NN support was added. |
Spec Test Coverage Analysis
|
Thanks so much for your help @alex-keeler. Please don't hesitate to pickup other missing/potentially incorrect parts of the search DSL, that would be much appreciated! |
Description
Updates the knn query spec to match how it is currently implemented in OpenSearch.
Issues Resolved
Closes #535
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.