perf: rrf code (#5558)

This commit is contained in:
Archer
2025-08-29 01:24:19 +08:00
committed by GitHub
parent e4756c76dd
commit a952539875
8 changed files with 504 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ export const datasetSearchResultConcat = (
item.list.forEach((data, index) => {
const rank = index + 1;
const score = (weight * 1) / (60 + rank);
const score = weight * (1 / (60 + rank));
const record = map.get(data.id);
if (record) {
// 合并两个score,有相同type的score,取最大值
@@ -64,8 +64,9 @@ export const datasetSearchResultConcat = (
});
}
// @ts-ignore
delete item.rrfScore;
return item;
return {
...item,
rrfScore: undefined
};
});
};