Skip to content

Commit

Permalink
scoring: show atom count in debug score
Browse files Browse the repository at this point in the history
Tiny change to display the atom count. I caught myself several times trying to
translate the score to an atom count.

Test plan:
Ran it locally
  • Loading branch information
stefanhengl committed Oct 20, 2023
1 parent c869a24 commit 61e1c23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (d *indexData) scoreFile(fileMatch *FileMatch, doc uint32, mt matchTree, kn
// atom-count boosts files with matches from more than 1 atom. The
// maximum boost is scoreFactorAtomMatch.
if atomMatchCount > 0 {
fileMatch.addScore("atom", (1.0-1.0/float64(atomMatchCount))*scoreFactorAtomMatch, opts.DebugScore)
fileMatch.addScore(fmt.Sprintf("atom(%d)", atomMatchCount), (1.0-1.0/float64(atomMatchCount))*scoreFactorAtomMatch, opts.DebugScore)
}

maxFileScore := 0.0
Expand Down

0 comments on commit 61e1c23

Please sign in to comment.