dsmiley opened a new pull request, #16484: URL: https://github.com/apache/lucene/pull/16484
-- to SpanMultiTermQueryWrapper See #7571 Adds a SpanRewriteMethod that bounds SpanMultiTermQueryWrapper expansion by retaining only the most frequent terms, ranked by document frequency (DF_ORDER) or document frequency then total term frequency (DF_THEN_TTF_ORDER), or any caller-supplied Comparator<ScoreTerm>. This offers a more meaningful cap than TopTermsSpanBooleanQueryRewrite, whose boost-based ordering degenerates to lexicographical order for most multi-term queries. It is built on ScoringRewrite rather than TopTermsRewrite because TopTermsRewrite caps terms while collecting them per segment, which requires a ranking key that is stable across segments (such as boost); document and total term frequencies are only per-segment during collection. ScoringRewrite instead collects every matching term first, aggregating TermStates across all segments, after which the maxSize most frequent terms are kept in a PriorityQueue using the aggregated statistics. Implements equals/hashCode over maxSize and the ordering Comparator for parity with TopTermsSpanBooleanQueryRewrite. Adds TestSpanMultiTermQueryWrapper.testFrequentTermsRewrite covering the frequency-based cap. -- 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]
