Fix scores when document has no text - [MOD-9423]#5958
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5958 +/- ##
==========================================
- Coverage 87.08% 87.06% -0.03%
==========================================
Files 211 211
Lines 38592 38595 +3
Branches 1893 1893
==========================================
- Hits 33609 33601 -8
- Misses 4976 4987 +11
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kei-nan
approved these changes
Apr 20, 2025
raz-mon
approved these changes
Apr 20, 2025
oshadmi
reviewed
Apr 20, 2025
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.8
git worktree add -d .worktree/backport-5958-to-2.8 origin/2.8
cd .worktree/backport-5958-to-2.8
git switch --create backport-5958-to-2.8
git cherry-pick -x 3588904e07656de9bbf6ad7b6e997f65f57396fa |
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.6
git worktree add -d .worktree/backport-5958-to-2.6 origin/2.6
cd .worktree/backport-5958-to-2.6
git switch --create backport-5958-to-2.6
git cherry-pick -x 3588904e07656de9bbf6ad7b6e997f65f57396fa |
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-5958-to-2.10 origin/2.10
cd .worktree/backport-5958-to-2.10
git switch --create backport-5958-to-2.10
git cherry-pick -x 3588904e07656de9bbf6ad7b6e997f65f57396fa |
redisearch-backport-pull-request bot
pushed a commit
that referenced
this pull request
Apr 20, 2025
* fix scorers * add a test (cherry picked from commit 3588904)
Contributor
|
Successfully created backport PR for |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 20, 2025
Fix scores when document has no text - [MOD-9423] (#5958) * fix scorers * add a test (cherry picked from commit 3588904) Co-authored-by: GuyAv46 <[email protected]>
GuyAv46
added a commit
that referenced
this pull request
Apr 20, 2025
* fix scorers * add a test (cherry picked from commit 3588904)
GuyAv46
added a commit
that referenced
this pull request
Apr 20, 2025
* fix scorers * add a test (cherry picked from commit 3588904)
GuyAv46
added a commit
that referenced
this pull request
Apr 20, 2025
* fix scorers * add a test (cherry picked from commit 3588904)
This was referenced Apr 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the changes in the pull request
Fix an edge case where the document has no text at all, causing its
maxFreqandlento be zero, and attempting to use this values to normalize the scores yieldsinffor non-zero scores, andnanfor zero scores (x/0and0/0respectively). This causes the obviously not matching document to score very high, yielding meaningless results that are preferred over better matches, or just messing with the sorting when comparing scores tonanMark if applicable