You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2014/05/17 07:56:14 UTC

[jira] [Updated] (LUCENE-5677) Simplify position handling in DefaultIndexingChain

     [ https://issues.apache.org/jira/browse/LUCENE-5677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Muir updated LUCENE-5677:
--------------------------------

    Attachment: LUCENE-5677.patch

heres a quick prototype. tests seem happy.

> 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
>         Attachments: 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org