lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-6278) Rationalise Scorer.freq()
Date Sat, 21 Feb 2015 19:52:11 GMT

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

Robert Muir commented on LUCENE-6278:
-------------------------------------

Sorry, I think we should not add this coord() method. This is like a 1970s horror only for
the default similarity and it should not be in all scorer apis, just booleanscorer. it can
handle these things another way...

This would be good, since we could just remove freq(). 

> Rationalise 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
>
>
> 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.3.4#6332)

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


Mime
View raw message