lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3849) position increments should be implemented by TokenStream.end()
Date Mon, 20 Aug 2012 21:29:38 GMT


Robert Muir commented on LUCENE-3849:

What about the "off-by-one" though? Because the problem is a full clearAttributes (which seems
correct), sets the posIncAtt to a default of 1.

This makes consuming the tokenstream awkward because you have to subtract 1 in this case.
should we do something like clearAttributes() + posIncAtt.setPositionIncrement(0) ?
> position increments should be implemented by TokenStream.end()
> --------------------------------------------------------------
>                 Key: LUCENE-3849
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 3.6, 4.0-ALPHA
>            Reporter: Robert Muir
>         Attachments: LUCENE-3849.patch
> if you have pages of a book as multivalued fields, with the default position increment
> of (0), phrase queries won't work across pages if one ends with stopword(s).
> This is because the 'trailing holes' are not taken into account in end(). So I think
> TokenStream.end(), subclasses of FilteringTokenFilter (e.g. stopfilter) should do:
> {code}
> super.end();
> posIncAtt += skippedPositions;
> {code}
> One problem is that these filters need to 'add' to the posinc, but currently nothing
> the attributes for end() [they are dirty, except offset which is set by the tokenizer].
> Also the indexer should be changed to pull posIncAtt from end().

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message