From 61e1c23a2372f2cbb8e9255ed09dd5c5b8f9fef8 Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Fri, 20 Oct 2023 15:36:22 +0200 Subject: [PATCH] scoring: show atom count in debug score 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 --- eval.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval.go b/eval.go index 538de354d..1901c8cff 100644 --- a/eval.go +++ b/eval.go @@ -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