From cc0196df772169d8c884ab503eef5871b2db366b Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 28 Oct 2024 16:33:33 -0700 Subject: [PATCH] chore(answer): sort the CodeSearchHit after merging same-file chunks (#3335) * chore(answer): sort the CodeSearchHit after merging same-file chunks * fix --- ee/tabby-webserver/src/service/answer.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/tabby-webserver/src/service/answer.rs b/ee/tabby-webserver/src/service/answer.rs index 7f359c3cf183..a1296e407f72 100644 --- a/ee/tabby-webserver/src/service/answer.rs +++ b/ee/tabby-webserver/src/service/answer.rs @@ -572,6 +572,8 @@ pub async fn merge_code_snippets( result.extend(file_hits); } } + + result.sort_by(|a, b| b.scores.rrf.total_cmp(&a.scores.rrf)); result }