airborne12 commented on code in PR #67180:
URL: https://github.com/apache/doris/pull/67180#discussion_r4090848003
##########
be/src/storage/index/inverted/query/phrase_query.cpp:
##########
@@ -53,6 +53,15 @@ void PhraseQuery::add(const InvertedIndexQueryInfo&
query_info) {
init_ordered_sloppy_phrase_matcher(query_info, is_similarity);
}
+ // Two-phase evaluation with a pushed-down candidate set: the candidate
+ // bitmap joins the leapfrog intersection (restricting doc-list walking and
+ // position verification to candidates) but never a matcher's postings, so
+ // phrase semantics stay with the real term iterators.
+ if (_context->candidate_rows != nullptr) {
+
_iterators.emplace_back(std::make_shared<RoaringDocIdIterator>(_context->candidate_rows));
+ _context->candidate_rows_consumed = true;
Review Comment:
Confirmed on the V2 CLucene path: a missing required posting marked the
candidate set as consumed and prevented caching of a segment-wide empty result.
Fixed in 56d7ff4c467 by joining candidates only when every required posting is
nonempty. A pre-fix test reproduced missed cache hits for missing phrase terms
and both prefix cases; the ASAN test now passes, including a check that a
candidate-restricted empty result stays uncached.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]