[ https://issues.apache.org/jira/browse/LUCENE-1542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714065#action_12714065 ]
Shai Erera commented on LUCENE-1542: ------------------------------------ Just wanted to say we've had an internal discussion at work about it, when we wanted to utilize the positions to encode integers, and found out that we always need to increment the position returned by 1 (i.e., if you set posIncr to 5, the position you get when iterating on the positions is 4), and we specifically did not understand why when you set the posIncr to 0 for the first position, Lucene writes a -1. (Well, we understood why it happens, but didn't understand the reason). So whatever you do here, I'm glad this issue was opened. We figured that the right solution on our side, w/o changing the Lucene code, is to not set the posIncr for the first position, but do so from the 2nd forward. Maybe that's what we need to do in Lucene? I.e. if posIncr is 0 for the first position, we don't decrement by 1? > Lucene can incorrectly set the position of tokens that start a field with > positonInc 0. > --------------------------------------------------------------------------------------- > > Key: LUCENE-1542 > URL: https://issues.apache.org/jira/browse/LUCENE-1542 > Project: Lucene - Java > Issue Type: Bug > Affects Versions: 2.4 > Reporter: Mark Miller > Priority: Minor > Fix For: 2.9 > > Attachments: LUCENE-1542.patch, LUCENE-1542.patch > > > More info in LUCENE-1465 -- 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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org