Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzq50 committed Dec 13, 2024
1 parent 495c925 commit 14ad802
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/storage/invertedindex/search/query_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ std::unique_ptr<DocIterator> OrQueryNode::CreateSearch(const CreateSearchParams
}
if ((params.early_term_algo == EarlyTermAlgo::kAuto || params.early_term_algo == EarlyTermAlgo::kBatch) &&
params.ft_similarity == FulltextSimilarity::kBM25 && term_children_need_batch()) {
// must have child other than term
// term_iters will be non-empty
Vector<std::unique_ptr<DocIterator>> term_iters;
Vector<std::unique_ptr<DocIterator>> not_term_iters = std::move(keyword_iters);
for (auto &iter : sub_doc_iters) {
Expand All @@ -658,8 +658,15 @@ std::unique_ptr<DocIterator> OrQueryNode::CreateSearch(const CreateSearchParams
not_term_iters.emplace_back(std::move(iter));
}
}
if (not_term_iters.empty()) {
assert(all_are_term_or_phrase);
sub_doc_iters = std::move(term_iters);
keyword_iters.clear();
return GetIterResultT.template operator()<BatchOrIterator>();
}
auto batch_or_iter = MakeUnique<BatchOrIterator>(std::move(term_iters));
not_term_iters.emplace_back(std::move(batch_or_iter));
// now at least 2 children in not_term_iters
if (params.minimum_should_match <= 0) {
return MakeUnique<OrIterator>(std::move(not_term_iters));
} else {
Expand Down

0 comments on commit 14ad802

Please sign in to comment.