diff options
| author | alex <[email protected]> | 2026-07-28 14:57:49 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-28 14:57:49 +0200 |
| commit | 9d0499041410a9b0be3686f79b4e36d7e7355dee (patch) | |
| tree | c0261dc911406b8eb9512b48314b29a069d0a80c /search/search.go | |
| parent | 68f62b4fd161f6563d29ac8a8e102218f59fae43 (diff) | |
| download | search-engine-9d0499041410a9b0be3686f79b4e36d7e7355dee.tar.xz search-engine-9d0499041410a9b0be3686f79b4e36d7e7355dee.zip | |
added TitlePositions and BodyPositions to the posting struct to prepare for proximity scoring
Diffstat (limited to 'search/search.go')
| -rw-r--r-- | search/search.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/search/search.go b/search/search.go index 5fb96f3..061c99c 100644 --- a/search/search.go +++ b/search/search.go @@ -28,7 +28,7 @@ func Search(idx *index.InvertedIndex, query string) []string { scores := make(map[int]int) for _, p := range basePostings { - scores[p.DocId] = p.Count + scores[p.DocId] = p.BodyCount } for i := 1; i < len(tokenizedQuery); i++ { @@ -40,7 +40,7 @@ func Search(idx *index.InvertedIndex, query string) []string { lookup := make(map[int]int) for _, p := range nextPostings { - lookup[p.DocId] = p.Count + lookup[p.DocId] = p.BodyCount } newScores := make(map[int]int) |
