fix(sql engine): misused group_count/group_topk (#531)

This commit is contained in:
Jalin Wang 2026-06-26 10:26:20 +08:00 committed by GitHub
parent c72bcd1ce9
commit 40e91d7fc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -714,7 +714,7 @@ Result<GroupResults> SQLEngineImpl::fill_group_by_result(
if (!typed_arr->IsNull(i)) {
// docs already order by score
auto &group_docs = group_to_docs[typed_arr->GetString(i)];
if (group_docs.size() < group_count) {
if (group_docs.size() < group_topk) {
group_docs.push_back(std::move(*docs[i]));
}
}
@ -732,8 +732,8 @@ Result<GroupResults> SQLEngineImpl::fill_group_by_result(
}
return a.docs_[0].score() < b.docs_[0].score();
});
if (group_results.size() > group_topk) {
group_results.resize(group_topk);
if (group_results.size() > group_count) {
group_results.resize(group_count);
}
for (auto &group_result : group_results) {
LOG_DEBUG("Group: %s", group_result.group_by_value_.c_str());