lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen (JIRA)" <>
Subject [jira] Commented: (LUCENE-697) Scorer.skipTo affects sloppyPhrase scoring
Date Sun, 05 Nov 2006 06:15:18 GMT
    [ ] 
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;
        return pp1.position < pp2.position;
      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:
>             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

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message