Skip to content

Remove Scorer.iterator [LUCENE-7765] #8816

@asfimport

Description

@asfimport

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions