-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
There are two ways that you can consume the documents that a Scorer matches: Scorer.iterator() and Scorer.twoPhaseIterator(), which is optional (it returns null if two-phase iteration is not supported). I think it made sense to make two-phase iteration optional in the beginning but it also has the drawback that it is too easy to forget to delegate two-phase iteration in compound queries (see eg. LUCENE-7654) so I am considering removing Scorer.iterator so that all scorers would be consumed using two-phase iteration.
It would probably be undesirable to use two-phase iteration on simple (combinations of) term queries, but I guess that could be easily addressed by using a special implementation of TwoPhaseIterator for the case that the approximation is accurate and eliminating it eg. in ConjunctionDISI.
Migrated from LUCENE-7765 by Adrien Grand (@jpountz), updated Apr 04 2017