lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <>
Subject [jira] [Commented] (LUCENE-6228) Do not expose full-fledged scorers in LeafCollector.setScorer
Date Tue, 04 Sep 2018 08:49:00 GMT


Adrien Grand commented on LUCENE-6228:

I think FilterScorable should not delegate setMinCompetitiveScore and keep the default impl
(like FilterScorer). Otherwise if you have a FilterScorable that overrides score() but not
setMinCompetitiveScore() this would be a bug? +1 otherwise, and +1 to prevent null weights
in the Scorer constructor as a follow-up.

> Do not expose full-fledged scorers in LeafCollector.setScorer
> -------------------------------------------------------------
>                 Key: LUCENE-6228
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Major
>             Fix For: 5.2, 6.0
>         Attachments: LUCENE-6228.patch, LUCENE-6228.patch, LUCENE-6228.patch, LUCENE-6228.patch,
LUCENE-6228.patch, LUCENE-6228.patch
> 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.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message