[
https://issues.apache.org/jira/browse/LUCENE-3475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346807#comment-16346807
]
Adrien Grand commented on LUCENE-3475:
--------------------------------------
[~mayyas] I think we need to do something like this indeed. We might also need
\{{getNextToken}} I don't think you should try to recreate a token stream from
the synonyms, however it is true that you need to record their state somewhere.
There are multiple ways to do this, for instance ShingleFilter uses
\{{cloneAttributes}}, but there is also {{captureState}}}}/\{{restoreState}}.
You can look at \{{EdgeNGramTokenFilter}} for an example of how to use them.
I haven't looked deeply at how the token filter currently works, but I wouldn't
be surprised that significant refactorings are required to make things work, so
feel free to reorganize the code if it makes this problem any easier to fix!
> ShingleFilter should handle positionIncrement of zero, e.g. synonyms
> --------------------------------------------------------------------
>
> Key: LUCENE-3475
> URL: https://issues.apache.org/jira/browse/LUCENE-3475
> Project: Lucene - Core
> Issue Type: New Feature
> Components: modules/analysis
> Affects Versions: 3.4
> Reporter: Cameron
> Priority: Minor
> Labels: newdev
>
> ShingleFilter is creating shingles for a single term that has been expanded
> by synonyms when it shouldn't. The position increment is 0.
> As an example, I have an Analyzer with a SynonymFilter followed by a
> ShingleFilter. Assuming car and auto are synonyms, the SynonymFilter produces
> two tokens and position 1: car, auto. The ShingleFilter is then producing 3
> tokens, when there should only be two: car, car auto, auto. This behavior
> seems incorrect.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]