[ 
https://issues.apache.org/jira/browse/LUCENE-1255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583794#action_12583794
 ] 

Hoss Man commented on LUCENE-1255:
----------------------------------

FWIW: Apparently Luke gets confused by this as well.

if i'm understanding correctly, the only reason position "-1" seems to come 
about is because of some internal counter that starts at "-1" since it assumes 
the first token will have an increment of "1" and thus: the first position used 
is "0"

Changing IndexWriter/DocumentsWriter/whatever to ignore the increment of the 
first Token, or make it realitve to "0" might be a better solution in general.

cases to consider: what should it mean for position info if:

- first token has increment of 0
- first token has increment of 1
- first token has increment of 27

in my opinion, the answers should probably be: 0, 1, 27 ... but i think that 
changes the common case of "1" (which would currently gets a position of "0" 
right?) ... so maybe the right behavior is 0,0,26



> CheckIndex should allow term position = -1
> ------------------------------------------
>
>                 Key: LUCENE-1255
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1255
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.4
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.3.2, 2.4
>
>         Attachments: LUCENE-1255.patch
>
>
> Spinoff from this discussion:
>     
> http://mail-archives.apache.org/mod_mbox/lucene-java-user/200803.mbox/[EMAIL 
> PROTECTED]
> Right now CheckIndex claims the index is corrupt if you index a Token with -1 
> position, which happens if your first token has positionIncrementGap set to 0.
> But, as far as I can tell, Lucene doesn't "mind" when this happens.
> So I plan to fix CheckIndex to allow this case.  I'll backport to 2.3.2 as 
> well.
> LUCENE-1253 is one example where Lucene's core analyzers could do this.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to