blob: 80aaffe992a131751389e92886943836c249fbfc (
plain)
1
2
3
4
5
6
7
8
9
10
|
package scoring
import "searchEngine/core/index"
var TitleWeight = 5.0
var BodyWeight = 1.0
func FieldScore(p index.Posting) float64 {
return (float64(len(p.TitlePositions)) * TitleWeight) + (float64(len(p.BodyPositions)) * BodyWeight)
}
|