github-actions[bot] commented on code in PR #69051:
URL: https://github.com/apache/doris/pull/69051#discussion_r4278499777
##########
be/src/storage/index/snii/snii_index_reader.cpp:
##########
@@ -643,8 +644,8 @@ Status SniiIndexReader::_query(const IndexQueryContextPtr&
context, const std::s
}
const bool actual_similarity =
- context->collection_similarity &&
- IndexReaderHelper::is_need_similarity_score(query_type,
&_index_meta);
+ context->collection_similarity &&
IndexReaderHelper::is_need_snii_similarity_score(
Review Comment:
[P1] Keep uncollected keyword filters out of the scoring path
`_query()` is also used by ordinary SQL filters, and
`SegmentIterator::_init_index_iterators()` attaches the same non-null
`collection_similarity` to every iterator in a score query. On an SNII table
with an analyzed `body` index and a keyword `tag` index, `SELECT id, score() AS
s FROM t WHERE SEARCH('body:apple') AND tag = 'x' ORDER BY s DESC LIMIT 10` now
sends the tag's `EQUAL_QUERY` through `score_plain_term_candidates()`. However,
`CollectionStatistics::extract_collect_info()` only collects MATCH/SEARCH
leaves, so no statistics exist for the equality filter's tag field:
`get_or_calculate_avg_dl()` throws `Index statistics collection failed: Not
such column ...`, failing a query that previously worked. Keyword MATCH
predicates have the same mismatch because `MatchPredicateCollector` explicitly
skips non-analyzed indexes. Please distinguish SEARCH leaf scoring from
ordinary filters, and keep reader eligibility consistent with the statistics
collected for each caller; add an SNI
I regression combining SEARCH/score() with an indexed keyword equality or
MATCH filter.
--
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]