lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Woodward (JIRA)" <>
Subject [jira] [Updated] (LUCENE-6278) Rationalise Scorer.freq()
Date Sat, 21 Feb 2015 18:51:11 GMT


Alan Woodward updated LUCENE-6278:
    Attachment: LUCENE-6278.patch


If we wanted to support back-compat we could add freq() back in as a deprecated method that
delegates to either coord() (for the boolean scorers) or the preserved freq() methods on TermScorer
and *PhraseScorer.

> Rationalise Scorer.freq()
> -------------------------
>                 Key: LUCENE-6278
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Priority: Minor
>         Attachments: 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 {X}PhraseScorer.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 {X}PhraseScorer.

This message was sent by Atlassian JIRA

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

View raw message