lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Woodward (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-6272) Scorer should not extend PostingsEnum
Date Fri, 20 Feb 2015 21:16:11 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-6272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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

Patch.  I also added a PhraseScorer abstract class with a phraseFreq() method that PhraseWeight.explain()
calls.

There are a couple of tests that walk the Scorer tree and check that TermScorers return the
correct freq() which I think we can just nuke?  Seeing as TermScorer.freq() is literally called
nowhere else in the codebase.

Alternatively, we could keep the existing freq() implementations for backwards-compatibility
purposes, deprecating them in 5x and removing in trunk.

> Scorer should not extend PostingsEnum
> -------------------------------------
>
>                 Key: LUCENE-6272
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6272
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Priority: Minor
>         Attachments: LUCENE-6272.patch
>
>
> Scorer currently has to implement a whole bunch of methods that are never called.  The
only method that Scorer uses in addition to the methods on DocIdSetIterator is freq(), and
as currently implemented this means different things on different Scorers:
> * TermScorer returns its underlying termfreq
> * MinShouldMatchScorer returns how many of its subscorers are matching
> * {Exact|Sloppy}PhraseScorer returns how many phrases it has found on a document
> In addition, freq() is never actually called on TermScorer, and it's only used in explain()
on the phrase scorers.
> We should make Scorer extend DocIdSetIterator instead.  In place of freq(), Scorer would
have a coord() method that by default returns 1, and for boolean scorers returns how many
subscorers are matching.



--
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