You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2013/10/30 00:38:25 UTC

[jira] [Commented] (LUCENE-5315) Some subclasses of Scorer do not honor the contract of DocsEnum.freq()

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

Robert Muir commented on LUCENE-5315:
-------------------------------------

I dont see the bug, as it said in  LUCENE-4514, its the number of matches in the document for that scorer.

So if its a Termscorer its the number of occurrences of that term. if its a phrasescorer its the number of occurrences of that phrase. If its a booleanscorer, its the number of occurrences of that boolean conjunct.

It does not try to 'sum' or anything. if you want to that, you can easily do it since you can navigate subscorers with getChildren.

> Some subclasses of Scorer do not honor the contract of DocsEnum.freq()
> ----------------------------------------------------------------------
>
>                 Key: LUCENE-5315
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5315
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/query/scoring
>    Affects Versions: 4.5.1
>            Reporter: Kai Chan
>         Attachments: DisjunctionMaxQueryTest.java, DisjunctionMaxQueryTest.java.output
>
>
> The behavior of Scorer.freq() is inconsistent across its subclasses:
> * For TermScorer, the freq() method behaves just as DocsEnum.freq() specifies, i.e. the method returns the "term frequency in the current document".
> * For BooleanScorer2, ConjunctionScorer, DisjunctionMaxScorer, DisjunctionSumScorer, and possibly other classes, the freq() method returns the number of clauses (in BooleanQuery or DisjunctionMaxQuery) that match the current document.
> This difference makes the meaning of Scorer.freq()'s return value uncertain. To add to the uncertainty, given a Query, there seems to be no way of knowing which behavior takes effect (as that is not specified in the API reference) except by reading or running the code.
> This issue might be related to LUCENE-4514.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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