You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Moti Nisenson (JIRA)" <ji...@apache.org> on 2008/07/06 14:02:31 UTC

[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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated LUCENE-1327:
--------------------------------

    Fix Version/s:     (was: 2.3.2)
                   2.3.3

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

-- 
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Busch updated LUCENE-1327:
----------------------------------

             Priority: Minor  (was: Major)
        Lucene Fields:   (was: [New])
    Affects Version/s:     (was: 3.0)
                           (was: 2.9)

> 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
>            Reporter: Moti Nisenson
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12621785#action_12621785 ] 

Mark Miller commented on LUCENE-1327:
-------------------------------------

I swear I saw this discussion in another issue...this a dupe?

In any case, if you use the isPayloadAvailable method before trying to get the payload, that should help. 

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

-- 
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Busch reassigned LUCENE-1327:
-------------------------------------

    Assignee: Michael Busch

> 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
>            Assignee: Michael Busch
>             Fix For: 2.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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Busch updated LUCENE-1327:
----------------------------------

    Fix Version/s:     (was: 2.3.1)
                       (was: 3.0)
                       (was: 2.9)
                       (was: 2.3)
                       (was: 2.2)
                       (was: 2.1)
                       (was: 2.0.0)
                       (was: 1.9)

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

-- 
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by Mark Miller <ma...@gmail.com>.
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ 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).

-- 
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated LUCENE-1327:
--------------------------------

    Fix Version/s:     (was: 2.3.3)
                   2.9

> 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.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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Busch updated LUCENE-1327:
----------------------------------

    Attachment: lucene-1327.patch

I think the right fix here is to simply remove these lines:
{code}
// are we already at the correct position?
if (doc >= target) { return true; }
{code}

Then TermSpans#skipTo() basically returns what the TermPositions#skipTo() call returns.
TermPositions#skipTo() has the same semantics as described in the javadocs of Spans#skipTo().

The patch I'm attaching contains a junit that fails before applying the fix, and passes after applying. All other tests pass too.

Any objections here? Otherwise I'll commit in a day or two.

> 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
>            Reporter: Moti Nisenson
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: lucene-1327.patch
>
>
> 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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael Busch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Busch resolved LUCENE-1327.
-----------------------------------

    Resolution: Fixed

Committed revision 756669.

> 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
>            Reporter: Moti Nisenson
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: lucene-1327.patch
>
>
> 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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-1327:
---------------------------------------

    Fix Version/s:     (was: 2.4)

We're still iterating on the approach to resolve this, and LUCENE-914, so I'm taking this out of 2.4.

> 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
>
>
> 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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


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

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626102#action_12626102 ] 

Mark Miller commented on LUCENE-1327:
-------------------------------------

Not an exact dupe by the way (spans vs scorer), but same issue, and from Dougs comment, should probably be handled in a similar manner (whatever is decided).

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

-- 
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@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org