Skip to content
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

Encapsulate KNNQueryBuilder creation within NeuralKNNQueryBuilder #1183

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

junqiu-lei
Copy link
Member

@junqiu-lei junqiu-lei commented Feb 11, 2025

Description

Centralizes KNNQueryBuilder creation in NeuralKNNQueryBuilder to:

  1. Put KNNQueryBuilder in a single location for easier handle breaking change from k-NN plugin.
  2. Provide abstraction for future extensions like for neural highlighter feature need the original query text as input, which is currently lost in kNNQuery object. More context can be found at "Neural Query Builder Wrapper (based on Highlighter Framework Approach)" in [RFC] OpenSearch Neural Sentence Highlighting #1175

Related Issues

Part of #1182

Check List

  • New functionality includes testing.
  • Commits are signed per the DCO using --signoff.

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.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.69%. Comparing base (ebfb058) to head (45b99f4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1183      +/-   ##
============================================
- Coverage     81.69%   81.69%   -0.01%     
+ Complexity     2489     1260    -1229     
============================================
  Files           186       95      -91     
  Lines          8434     4282    -4152     
  Branches       1428      717     -711     
============================================
- Hits           6890     3498    -3392     
+ Misses         1002      511     -491     
+ Partials        542      273     -269     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@junqiu-lei junqiu-lei changed the title Isolate KNNQueryBuilder creation in NeuralKNNQueryBuilder Encapsulate KNNQueryBuilder creation within NeuralKNNQueryBuilder Feb 12, 2025
Copy link
Member

@martin-gaievski martin-gaievski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thanks

heemin32
heemin32 previously approved these changes Feb 12, 2025
@heemin32 heemin32 dismissed their stale review February 12, 2025 02:18

Need to fix bwc test failure.

@martin-gaievski
Copy link
Member

martin-gaievski commented Feb 12, 2025

if this change is for 3.0 we need to look into BWC 3.0 -> 2.19, that's our current strategy, support rolling upgrades to latest minor of previous major, we probably should continue doing same after 3.x will be released. Of course this makes more sense if errors in BWC are hard to fix, proper deep dive is required

@junqiu-lei
Copy link
Member Author

if this change is for 3.0 we need to look into BWC 3.0 -> 2.19, that's our current strategy, support rolling upgrades to latest minor of previous major, we probably should continue doing same after 3.x will be released. Of course this makes more sense if errors in BWC are hard to fix, proper deep dive is required

Makes sense, looking into the bwc tests failure.

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
@junqiu-lei
Copy link
Member Author

junqiu-lei commented Feb 12, 2025

The 2.19->3.0.0 bwc test failed due to known issue #1142.

@junqiu-lei junqiu-lei requested a review from heemin32 February 12, 2025 22:33
@junqiu-lei junqiu-lei merged commit 0769ad7 into opensearch-project:main Feb 12, 2025
72 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neural-search Refactoring Improve the design, structure, and implementation while preserving its functionality v3.0.0 v3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants