[jira] [Commented] (LUCENE-6278) Remove Scorer.freq()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (LUCENE-6278) Remove Scorer.freq()

JIRA jira@apache.org

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

David Smiley commented on LUCENE-6278:
--------------------------------------

It's nice to see the patch removes lots of little implementations all over the place, thus simplifying a lot.  I was going to suggest a ScorerWithFreq subclass but in the end it wouldn't solve any of the unfortunate needs to cast, so nevermind.

> Remove Scorer.freq()
> --------------------
>
>                 Key: LUCENE-6278
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6278
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-6278.patch, LUCENE-6278.patch, LUCENE-6278.patch
>
>
> At the moment, Scorer.freq() does different things depending on the Scorer implementation:
> * TermScorer and the phrase scorers return the frequency of that term or phrase in the current document.  TermScorer.freq() is not actually called anywhere (apart from in a couple of tests), and XPhraseScorer.freq() is only called in PhraseWeight.explain()
> * The various Boolean scorers return the number of matching subscorers, and are used for coord calculations.
> I think this is confusing.  I propose that we instead add a new coord() method to Scorer that by default returns 1, and that is overridden by the boolean scorers; and that we just remove freq() entirely.  PhraseWeight.explain() can call a package-private method on XPhraseScorer.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]