You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Ryan Ernst (JIRA)" <ji...@apache.org> on 2015/02/09 19:10:35 UTC

[jira] [Comment Edited] (LUCENE-6228) Do not expose full-fledged scorers in LeafCollector.setScorer

    [ https://issues.apache.org/jira/browse/LUCENE-6228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14312551#comment-14312551 ] 

Ryan Ernst edited comment on LUCENE-6228 at 2/9/15 6:10 PM:
------------------------------------------------------------

Having both {{Score}} and {{Scorer}} is really confusing...can we have the interface still be {{Scorer}} and the abstract class be something else...maybe {{ScoringEnum}}?


was (Author: rjernst):
Having both {{Score}} and {{Scorer} is really confusing...can we have the interface still be {{Scorer}} and the abstract class be something else...maybe {{ScoringEnum}}?

> Do not expose full-fledged scorers in LeafCollector.setScorer
> -------------------------------------------------------------
>
>                 Key: LUCENE-6228
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6228
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>             Fix For: Trunk, 5.1
>
>         Attachments: 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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org