reugn opened a new pull request, #16981: URL: https://github.com/apache/lucene/pull/16981
`DrillSidewaysScorer` can only score a whole segment in one call and throws an `IllegalArgumentException` otherwise. So `DrillSideways` fails when the searcher has a timeout, since `TimeLimitingBulkScorer` scores a segment in windows of doc IDs, and when segments are split into partitions for intra-segment concurrency. Tests had to disable both. This change makes `DrillSidewaysScorer` score any range of doc IDs and continue where the previous call stopped: - The query-first strategy stops at `max`. The drill-down-advance and union strategies score the windows between `min` and `max`, and reuse their per-window arrays across calls. - `score` returns the next doc that can be a hit or a near-miss instead of always `NO_MORE_DOCS`. - The sideways leaf collectors were finished at the end of `score`, which doesn't work when a segment is scored in several calls. `DrillSideways` now finishes them once the search completed, so they are no longer finished when the search fails, as documented in `LeafCollector#finish`. The new tests also found a bug on `main`. In drill-down-advance, the second dim skipped the two-phase check in segments without deletions because of operator precedence, so docs that only matched the approximation were counted. This is fixed here as well. The test base classes no longer disable timeouts and intra-segment concurrency for `DrillSideways`. The new `TestDrillSidewaysScorer` checks each strategy against the hits and near-misses computed from the indexed docs, both when a segment is scored at once and in random ranges. This is also a prerequisite for #16973, which scores the segments of multi-slice searches in ranges. Closes #13753 Closes #12032 -- 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]
