You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Doron Cohen (JIRA)" <ji...@apache.org> on 2011/09/08 11:45:08 UTC
[jira] [Commented] (LUCENE-3215) SloppyPhraseScorer sometimes
computes Infinite freq
[ https://issues.apache.org/jira/browse/LUCENE-3215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13100182#comment-13100182 ]
Doron Cohen commented on LUCENE-3215:
-------------------------------------
An update on this...
This is not related to LUCENE-3142 - the latter was fixed but this one still fails.
The patch fix which 'abs' the distance indeed avoids the infinite score problem, but I was not 100% comfortable with it - how can the distance be none positive?
Digging into it shows a wrong assumption in SloppyPhraseScorer:
{code}
private int initPhrasePositions() throws IOException {
int end = 0;
{code}
The initial value of end assumes that all positions will be nonnegative.
But this is wrong, as PP position is computed as
{code}
position = postings.nextPosition() - offset
{code}
So, whenever the query term appears in the doc in a position smaller than its offset in the query, the computed position is negative. The correct initialization for end is therefore:
{code}
private int initPhrasePositions() throws IOException {
int end = Integer.MIN_VALUE;
{code}
You would expect this bug to surfaced sooner...
Anyhow, for the 3 tests that Robert added, this only resolve testInfiniteFreq1() but the other two tests still fail, investigating...
> SloppyPhraseScorer sometimes computes Infinite freq
> ---------------------------------------------------
>
> Key: LUCENE-3215
> URL: https://issues.apache.org/jira/browse/LUCENE-3215
> Project: Lucene - Java
> Issue Type: Bug
> Reporter: Robert Muir
> Assignee: Doron Cohen
> Attachments: LUCENE-3215.patch, LUCENE-3215_test.patch, LUCENE-3215_test.patch
>
>
> reported on user list:
> http://www.lucidimagination.com/search/document/400cbc528ed63db9/score_of_infinity_on_dismax_query
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org