[
https://issues.apache.org/jira/browse/LUCENE-5677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000786#comment-14000786
]
ASF subversion and git services commented on LUCENE-5677:
---------------------------------------------------------
Commit 1595475 from [~rcmuir] in branch 'dev/branches/branch_4x'
[ https://svn.apache.org/r1595475 ]
LUCENE-5677: simplify position handling in DefaultIndexingChain
> Simplify position handling in DefaultIndexingChain
> --------------------------------------------------
>
> Key: LUCENE-5677
> URL: https://issues.apache.org/jira/browse/LUCENE-5677
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Fix For: 4.9, 5.0
>
> Attachments: LUCENE-5677.patch, LUCENE-5677.patch
>
>
> There are currently a ton of conditionals checking for various problems, as
> well as a horribly confusing unbalanced decrement + increment, and in general
> the code is a nightmare to follow.
> To make it worse, besides being confusing it doesnt handle all cases: e.g. a
> negative position increment gap from the analyzer will just result in total
> chaos (corruption etc).
> I think an easier way to implement this is to init fieldinvertstate.position
> to -1, and for the logic to be:
> {code}
> position += posincr;
> check that position >= 0 && position >= lastPosition
> lastPosition = position;
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]