Currently LeafCollector.setScorer takes a Scorer, which I don't like because several methods should never be called in the context of a Collector (like nextDoc or advance).
I think it's even more trappy for methods that might seem to work in some particular cases but will not work in the general case, like getChildren which will not work if you have a specialized BulkScorer or iterating over positions which will not work if you are in a MultiCollector and another leaf collector consumes positions too.
So I think we should restrict what can be seen from a collector to avoid such traps.
Migrated from LUCENE-6228 by Adrien Grand (@jpountz), resolved Sep 04 2018
Attachments: LUCENE-6228.patch (versions: 6)
Linked issues:
Currently LeafCollector.setScorer takes a Scorer, which I don't like because several methods should never be called in the context of a Collector (like nextDoc or advance).
I think it's even more trappy for methods that might seem to work in some particular cases but will not work in the general case, like getChildren which will not work if you have a specialized BulkScorer or iterating over positions which will not work if you are in a MultiCollector and another leaf collector consumes positions too.
So I think we should restrict what can be seen from a collector to avoid such traps.
Migrated from LUCENE-6228 by Adrien Grand (@jpountz), resolved Sep 04 2018
Attachments: LUCENE-6228.patch (versions: 6)
Linked issues: