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

Michael McCandless commented on LUCENE-1542:
--------------------------------------------

bq. My question is - when will those -1 positions be fixed?

I think the app must decide that?  I don't think we should correct it
during merging, since that'd sneakily change your index whenever
merges complete?

We could leave this deprecated "keep the bug" method around until 4.0?
This way you'd have until 4.0 to reindex.

bq. I think this breaks back-compat

Right, my patch breaks back compat, but I think this bug warrants an
exception.

This is a bad bad bug.  Not only does it corrupt your positions
(storing Int.MAX_VALUE instead of -1, and then storing the next
position as Int.MIN_VALUE), it also can allow that corruption to
spread as segments are merged (if those other segments didn't have
docs w/ payloads).  And, it causes Span*Query to return the wrong
results in some cases.

I think new users shouldn't have to wait until 4.0 to see this bug
fixed?

I suppose an alternate approach would be to leave the -1 bug in place,
and only fix the case when there are payloads.  It'd be messy.  I
think we'd have to fix SegmentTermPositions to add an "if (firstTime
&& pos==Integer.MAX_VALUE)" to rewire it back to -1.  If we did this
we'd be back to Lucene's "oddity".  It's not great because it's a perf
cost on the search side...


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

Reply via email to