-
Notifications
You must be signed in to change notification settings - Fork 127
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
Add parent join support for lucene knn #1182
Conversation
@heemin32 can you add an example how you tested this change? |
src/main/java/org/opensearch/knn/index/query/KNNQueryFactory.java
Outdated
Show resolved
Hide resolved
3536368
to
91c200d
Compare
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1182 +/- ##
============================================
+ Coverage 84.95% 85.01% +0.06%
- Complexity 1190 1210 +20
============================================
Files 159 160 +1
Lines 4838 4932 +94
Branches 440 449 +9
============================================
+ Hits 4110 4193 +83
- Misses 530 540 +10
- Partials 198 199 +1
|
@@ -86,10 +89,12 @@ public static Query create(CreateQueryRequest createQueryRequest) { | |||
return new KNNQuery(fieldName, vector, k, indexName); | |||
} | |||
|
|||
log.debug(String.format("Creating Lucene k-NN query for index: %s \"\", field: %s \"\", k: %d", indexName, fieldName, k)); | |||
BitSetProducer parentFilter = createQueryRequest.context == null ? null : createQueryRequest.context.getParentFilter(); |
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.
who is setting this parent filter in the CreateQueryRequest?
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.
@heemin32 can we add benchmarks around this feature, what your thought? |
That is a great idea. However, I would like to defer the effort until there is strong needs for the benchmark as we need to construct test data by ourselves for the nested field which might take some amount of efforts. |
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit a496926)
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit a496926)
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit a496926)
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit a496926)
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result Signed-off-by: Heemin Kim <[email protected]> (cherry picked from commit a496926) Co-authored-by: Heemin Kim <[email protected]>
Description
Call DiversifyingChildren[Byte|Float]KnnVectorQuery for nested field so that k number of parent document can be returned in search result
Issues Resolved
#1065
Check List
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.