-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ranking: include filename matches in bm25 (#757)
BM25 considers a file to be a better match when there are many occurrences of terms in the file. It's important to count all term occurrences, including those in other fields like the filename. For historical reasons, Zoekt trims all filename matches from a result if there are any content matches. This meant that in BM25 scoring, we didn't account for filename matches. This PR refactors the match code so that we only trim filename matches when assembling the final `FileMatch`. We retain filename matches when creating `candidateMatch`, which lets BM25 scoring use them. Even without the better BM25 scoring, I think this refactor makes the code easier to follow.
- Loading branch information
1 parent
59ab949
commit 43b9225
Showing
4 changed files
with
193 additions
and
118 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.