refactor(chat): 优化候选查询排序逻辑
Some checks failed
supersonic CentOS CI / build (21) (push) Has been cancelled
supersonic mac CI / build (21) (push) Has been cancelled
supersonic ubuntu CI / build (21) (push) Has been cancelled
supersonic windows CI / build (21) (push) Has been cancelled

- 移除不必要的 limit(1) 操作以保留所有排序后的候选查询
- 保持按分数降序排列的排序规则不变
This commit is contained in:
jerryjzhang
2026-05-27 20:12:02 +08:00
parent 5b77b39c60
commit d2ae1509cb

View File

@@ -56,8 +56,7 @@ public class ChatQueryContext implements Serializable {
candidateQueries = candidateQueries.stream()
.sorted(Comparator.comparing(
semanticQuery -> semanticQuery.getParseInfo().getScore(),
Comparator.reverseOrder()))
.limit(1).collect(Collectors.toList());
Comparator.reverseOrder())).collect(Collectors.toList());
return candidateQueries;
}