Skip to content

Commit

Permalink
score: remove repetition-boost (#667)
Browse files Browse the repository at this point in the history
The definition of how this is applied is very narrow and more often than
not works poorly. Originally I sent out a commit to dampen this using
log, but Julie suggested just removing which sounds better.

Test Plan: go test
  • Loading branch information
keegancsmith authored Oct 20, 2023
1 parent 7cc2872 commit d3fc0dc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion contentprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ const (
scoreSymbol = 7000.0
scorePartialSymbol = 4000.0
scoreKindMatch = 100.0
scoreRepetitionFactor = 1.0
scoreFactorAtomMatch = 400.0

// File-only scoring signals. For now these are also bounded ~9000 to give them
Expand Down
7 changes: 0 additions & 7 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,9 @@ func (d *indexData) scoreFile(fileMatch *FileMatch, doc uint32, mt matchTree, kn
}

maxFileScore := 0.0
repetitions := 0
for i := range fileMatch.LineMatches {
if maxFileScore < fileMatch.LineMatches[i].Score {
maxFileScore = fileMatch.LineMatches[i].Score
repetitions = 0
} else if maxFileScore == fileMatch.LineMatches[i].Score {
repetitions += 1
}

// Order by ordering in file.
Expand All @@ -442,9 +438,6 @@ func (d *indexData) scoreFile(fileMatch *FileMatch, doc uint32, mt matchTree, kn
// the matches.
fileMatch.addScore("fragment", maxFileScore, opts.DebugScore)

// Prefer docs with several top-scored matches.
fileMatch.addScore("repetition-boost", scoreRepetitionFactor*float64(repetitions), opts.DebugScore)

if opts.UseDocumentRanks && len(d.ranks) > int(doc) {
weight := scoreFileRankFactor
if opts.DocumentRanksWeight > 0.0 {
Expand Down

0 comments on commit d3fc0dc

Please sign in to comment.