diff options
| author | alex <[email protected]> | 2026-07-28 20:01:28 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-28 20:01:28 +0200 |
| commit | 95ccea8d0244e515947c335ace620838f01be60a (patch) | |
| tree | 1bce68640f72ba4c010f2abecc89d3e61460ab29 /core/scoring/field.go | |
| parent | c91c3afd8700138f8eb8a25a4ae422c2c9e46cea (diff) | |
| download | search-engine-95ccea8d0244e515947c335ace620838f01be60a.tar.xz search-engine-95ccea8d0244e515947c335ace620838f01be60a.zip | |
forgor :skull:
Diffstat (limited to 'core/scoring/field.go')
| -rw-r--r-- | core/scoring/field.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/scoring/field.go b/core/scoring/field.go index 89f6132..80aaffe 100644 --- a/core/scoring/field.go +++ b/core/scoring/field.go @@ -6,5 +6,5 @@ var TitleWeight = 5.0 var BodyWeight = 1.0 func FieldScore(p index.Posting) float64 { - return (float64(p.TitleCount) * TitleWeight) + (float64(p.BodyCount) * BodyWeight) + return (float64(len(p.TitlePositions)) * TitleWeight) + (float64(len(p.BodyPositions)) * BodyWeight) } |
