Looks like a link comment doesn't go to the mailing list. From JIRA:

I found the issue this one dupes. It looks to me like relaxing the spec is the most likely fix. I don't know if that solves this guys problem though - is calling isPayloadAvailable good enough, or is his logic screwed up as a result...

The dupe is: https://issues.apache.org/jira/browse/LUCENE-914

- Mark Miller


Michael McCandless (JIRA) wrote:
[ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626050#action_12626050 ]
Michael McCandless commented on LUCENE-1327:
--------------------------------------------

This is indeed a bug in that the implementation does not match the javadocs.  
Mark or Grant, what should we do here?

TermSpans skipTo() doesn't always move forwards
-----------------------------------------------

                Key: LUCENE-1327
                URL: https://issues.apache.org/jira/browse/LUCENE-1327
            Project: Lucene - Java
         Issue Type: Bug
         Components: Query/Scoring, Search
   Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1, 2.3.2, 2.4, 2.9, 3.0
           Reporter: Moti Nisenson
            Fix For: 2.3.3, 2.4


In TermSpans (or the anonymous Spans class returned by SpansTermQuery, 
depending on the version), the skipTo() method is improperly implemented if the 
target doc is less than or equal to the current doc:
  public boolean skipTo(int target) throws IOException {
          // are we already at the correct position?
          if (doc >= target) {
            return true;
          }
          ...
This violates the correct behavior (as described in the Spans interface 
documentation), that skipTo() should always move forwards, in other words the 
correct implementation would be:
if (doc >= target) {
  return next();
}
This bug causes particular problems if one wants to use the payloads feature - this is 
because if one loads a payload, then performs a skipTo() to the same document, then tries 
to load the "next" payload, the spans hasn't changed position and it attempts 
to load the same payload again (which is an error).



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to