Skip to content

Commit 6561b72

Browse files
committed
Debugging minscore failure
1 parent 4d3c5b5 commit 6561b72

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/linear/LinearRetrieverBuilder.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,21 @@ protected RankDoc[] combineInnerRetrieverResults(List<ScoreDoc[]> rankResults, b
197197
if (minScore == DEFAULT_MIN_SCORE) {
198198
filteredResults = sortedResults;
199199
} else {
200-
filteredResults = Arrays.stream(sortedResults).filter(doc -> doc.score >= minScore).toArray(LinearRankDoc[]::new);
200+
filteredResults = Arrays.stream(sortedResults)
201+
.filter(doc -> {
202+
// Ensure we're comparing against the final combined score
203+
float finalScore = doc.score;
204+
return finalScore >= minScore;
205+
})
206+
.toArray(LinearRankDoc[]::new);
201207
}
202208
// trim the results if needed, otherwise each shard will always return `rank_window_size` results.
203209
LinearRankDoc[] topResults = new LinearRankDoc[Math.min(rankWindowSize, filteredResults.length)];
204210
for (int rank = 0; rank < topResults.length; ++rank) {
205211
topResults[rank] = filteredResults[rank];
206212
topResults[rank].rank = rank + 1;
207213
}
214+
System.out.println("topResults: " + topResults.length);
208215
return topResults;
209216
}
210217

0 commit comments

Comments
 (0)