Skip to content

Commit 1cc5fa8

Browse files
fix: Fix rrf score (#41857)
#41835 Signed-off-by: junjie.jiang <[email protected]>
1 parent 0bbbf98 commit 1cc5fa8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/proxy/reScorer.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ type rrfScorer struct {
6666
}
6767

6868
func (rs *rrfScorer) reScore(input *milvuspb.SearchResults) {
69-
for i := range input.Results.GetScores() {
70-
input.Results.Scores[i] = 1 / (rs.k + float32(i+1))
69+
index := 0
70+
for _, topk := range input.Results.GetTopks() {
71+
for i := int64(0); i < topk; i++ {
72+
input.Results.Scores[index] = 1 / (rs.k + float32(i+1))
73+
index++
74+
}
7175
}
7276
}
7377

0 commit comments

Comments
 (0)