reugn opened a new pull request, #16967: URL: https://github.com/apache/lucene/pull/16967
`TotalHitCountCollectorManager` always counts every hit. `TopScoreDocCollectorManager` and `TopFieldCollectorManager` can stop counting past a `totalHitsThreshold`, but they also collect top hits and need `numHits > 0`. This change adds `PartialHitCountCollectorManager` and `PartialHitCountCollector` to the misc module. They count hits like `TotalHitCountCollector`, but stop once the hits counted by all collectors exceed a threshold. If the query matches at most the threshold, the count is exact with `EQUAL_TO`. Once counting stops early, it is a lower bound above the threshold with `GREATER_THAN_OR_EQUAL_TO`. With concurrent slices, the value can differ between runs. Collectors share one `AtomicLong` and sync with it every 1024 hits at most, the same interval as `MaxScoreAccumulator`. Between syncs, a collector counts at most the hits left until the threshold divided by the number of slices, so concurrent slices don't each count up to the threshold. Segments counted from `Weight#count` and `DocIdStream` batches are counted in full, so the value can overshoot the threshold. The manager wraps `TotalHitCountCollectorManager`, so segment partitions don't count a segment twice. Closes #12230 -- 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]
