Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
I started working on LUCENE-10385 and chatting with jpountz we said that maybe the javadocs around Weight#count could be clarified around when it should be implemented. It currently mentions that the method should only be overridden by sub-classes that are able to compute/retrieve the count in O(1) time. The intention is that computing the count should be fast and have a much smaller overhead compared to collecting all matches. Possibly the requirement could be relaxed to sub-linear time instead of strictly linear time? In fact, in LUCENE-10385 we would use binary search to compute the count which does not execute in linear time but rather O(log N) which though seems to be acceptable.
Attachments
Issue Links
- links to