lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-697) Scorer.skipTo affects sloppyPhrase scoring
Date Sun, 05 Nov 2006 06:15:18 GMT
    [ http://issues.apache.org/jira/browse/LUCENE-697?page=comments#action_12447234 ] 
            
Doron Cohen commented on LUCENE-697:
------------------------------------

You're right Yonik,   pp1.offset < pp2.offset   is equivalent. 

However note that pp1.position + pp1.offset  == tp1.position, i.e. by adding the (query) offset
we compare the termPosition offsets, as read from the index. 

Just to complete the setting - having pp.position == tp.position - offset allows the phrase
scorer to identify a match when all pp.positions are the same (for exact) or distant no more
than slope (for sloppy). 

So we should probably return the simpler expression as you suggest, and comment the code,
something like this:

    if (pp1.doc == pp2.doc) 
      if (pp1.position == pp2.position)
        // Same doc and pp.positions, so compare *actual term positions*.
        // Since pp.position == tp.position - (query) offset, 
        // can restore tp.position as pp.position + offset.
        // But pp.positions are equal, so can just compare the offsets. 
        return pp1.offset < pp2.offset;
      else
        return pp1.position < pp2.position;
    else
      return pp1.doc < pp2.doc;

makes sense?

Perhaps it would be nice if we also add some code comments to the scorers...?

> Scorer.skipTo affects sloppyPhrase scoring
> ------------------------------------------
>
>                 Key: LUCENE-697
>                 URL: http://issues.apache.org/jira/browse/LUCENE-697
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.0.0
>            Reporter: Yonik Seeley
>         Assigned To: Doron Cohen
>         Attachments: sloppy_phrase_skipTo.patch, sloppy_phrase_skipTo.patch2
>
>
> If you mix skipTo() and next(), you get different scores than what is returned to a hit
collector.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message