lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Updated] (LUCENE-5677) Simplify position handling in DefaultIndexingChain
Date Sat, 17 May 2014 12:49:15 GMT


Robert Muir updated LUCENE-5677:

    Attachment: LUCENE-5677.patch

Slightly tweaked patch: just handles the offsets with the same logic for consistency, and
adds a test for "crazyOffsetGap"

This removes another conditional and just makes it simpler. I also pulled out the 'boost &&
omitNorms check' into the caller, because its unrelated to inverting the tokenstream. 

We should try to keep invert() simple.

> Simplify position handling in DefaultIndexingChain
> --------------------------------------------------
>                 Key: LUCENE-5677
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message