Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

[jira] Created: (LUCENE-1327) TermSpans skipTo() doesn't always move forwards

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


jira at apache

Jul 6, 2008, 5:02 AM

Post #1 of 1 (118 views)
Permalink
[jira] Created: (LUCENE-1327) TermSpans skipTo() doesn't always move forwards

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: 2.3.1, 2.3, 2.2, 2.1, 2.0.0, 1.9, 2.3.2, 2.4, 2.9, 3.0
Reporter: Moti Nisenson
Fix For: 2.3.2, 2.4, 2.9, 3.0, 2.3.1, 2.3, 2.2, 2.1, 2.0.0, 1.9


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).

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.