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/08 10:09:32 UTC

[jira] Created: (LUCENE-1330) 0 position increment not properly supported for the first token

0 position increment not properly supported for the first token
---------------------------------------------------------------

                 Key: LUCENE-1330
                 URL: https://issues.apache.org/jira/browse/LUCENE-1330
             Project: Lucene - Java
          Issue Type: Bug
          Components: Javadocs, Store
            Reporter: Moti Nisenson


Setting a position increment of 0 for the first token in a field results in its "absolute position" (as well as increment) being read back later as Integer.MIN_VALUE.

This is a result of how the information gets written out in DocumentsWriter: position should not be updated using += t.getPositionIncrement() - 1; and then always ++'ed in addPosition. It would be much simpler just to update it using t.getPositionIncrement().

While this is fairly easy to fix in DocumentsWriter, one could just update the documentation for Token.setPositionIncrement() to indicate that for indexing purposes the first Token in a field must have a positive position increment.

-- 
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-1330) 0 position increment not properly supported for the first token

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

Michael McCandless resolved LUCENE-1330.
----------------------------------------

    Resolution: Duplicate

Dup of LUCENE-1255.

> 0 position increment not properly supported for the first token
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1330
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1330
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Javadocs, Store
>            Reporter: Moti Nisenson
>
> Setting a position increment of 0 for the first token in a field results in its "absolute position" (as well as increment) being read back later as Integer.MIN_VALUE.
> This is a result of how the information gets written out in DocumentsWriter: position should not be updated using += t.getPositionIncrement() - 1; and then always ++'ed in addPosition. It would be much simpler just to update it using t.getPositionIncrement().
> While this is fairly easy to fix in DocumentsWriter, one could just update the documentation for Token.setPositionIncrement() to indicate that for indexing purposes the first Token in a field must have a positive position increment.

-- 
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-1330) 0 position increment not properly supported for the first token

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615191#action_12615191 ] 

Michael McCandless commented on LUCENE-1330:
--------------------------------------------

In LUCENE-1255, we tried to correct DocumentsWriter to write absolute position as 0 not -1 in this case, but unfortunately this broke backwards compatibility so we decided to leave it be.

But: in this case the absolute position should read back later as -1, not Integer.MIN_VALUE -- where are you seeing Integer.MIN_VALUE?

> 0 position increment not properly supported for the first token
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1330
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1330
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Javadocs, Store
>            Reporter: Moti Nisenson
>
> Setting a position increment of 0 for the first token in a field results in its "absolute position" (as well as increment) being read back later as Integer.MIN_VALUE.
> This is a result of how the information gets written out in DocumentsWriter: position should not be updated using += t.getPositionIncrement() - 1; and then always ++'ed in addPosition. It would be much simpler just to update it using t.getPositionIncrement().
> While this is fairly easy to fix in DocumentsWriter, one could just update the documentation for Token.setPositionIncrement() to indicate that for indexing purposes the first Token in a field must have a positive position increment.

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