-
Notifications
You must be signed in to change notification settings - Fork 129
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] Use the Lucene Distance Calculation Function in Script Scoring for doing exact search #1287
Conversation
…mularity Signed-off-by: TrungBui59 <[email protected]>
Signed-off-by: TrungBui59 <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1287 +/- ##
============================================
- Coverage 85.07% 85.02% -0.06%
Complexity 1210 1210
============================================
Files 160 160
Lines 4930 4920 -10
Branches 449 449
============================================
- Hits 4194 4183 -11
- Misses 537 540 +3
+ Partials 199 197 -2
|
@TrungBui59 Can you add the entry for this in Changelog.md file |
@@ -294,11 +295,7 @@ public static float lInfNorm(List<Number> queryVector, KNNVectorScriptDocValues | |||
*/ | |||
public static float innerProduct(float[] queryVector, float[] inputVector) { | |||
requireEqualDimension(queryVector, inputVector); |
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.
I think this check is present in Lucene code, we can remove it just like we removed from l2Squared
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.
@navneet1v Yes, I would love to start with something small.
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.
Overall code looks fine to me. @jmazanec15 as you are aware more around the distances on both lucene and k-NN side. Can you please review and see if things are intact.
Signed-off-by: TrungBui59 <[email protected]>
Signed-off-by: TrungBui59 <[email protected]>
} | ||
try { | ||
cosine = VectorUtil.cosine(queryVector, inputVector); | ||
} catch (Exception e) { |
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.
Can we avoid catching all exceptions here or catch a more specific exception?
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.
@jmazanec15 Sure I will change it
@TrungBui59 can you resolve the comments so that we can merge the changes |
@TrungBui59 are you still working on this PR? |
@TrungBui59 are you still working on this? if not can we close this PR or someone else can pick up the github issue? |
@navneet1v I would love to pick up this. |
Closing this PR due to no further activity from author. Also there is a PR raised for similar feature. Ref: #1699 |
Description
Change our implementation to use Lucene for calculating distance
Issues Resolved
#1032
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.