[ https://issues.apache.org/jira/browse/LUCENE-4955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13640657#comment-13640657 ]
Jack Krupansky commented on LUCENE-4955: ---------------------------------------- I think that ngram filter and edge-ngram filter are rather different cases. With edge-ngram it is abundantly clear that all of the edge ngrams "stack up" at the same position (at least for "front" edge ngrams!). But embedded ngrams seem more like a stretching out of the token, from one token to a sequence of tokens. Actually, it is k overlayed sequences, where k = maxGramSize minus minGramSize plus 1. I think the solution should be to have a "mode" which indicates whether the "intent" is merely variations (sub-tokens) for the token at the same position vs. a stretching the token into a sequence of tokens. Maybe call it "expansionMode": "stack" vs. "sequence". But even for the latter, I would definitely recommend that each of the k sequences should restart the position at the original token position. > NGramTokenFilter increments positions for each gram > --------------------------------------------------- > > Key: LUCENE-4955 > URL: https://issues.apache.org/jira/browse/LUCENE-4955 > Project: Lucene - Core > Issue Type: Bug > Components: modules/analysis > Affects Versions: 4.3 > Reporter: Simon Willnauer > Fix For: 5.0, 4.4 > > Attachments: highlighter-test.patch, LUCENE-4955.patch > > > NGramTokenFilter increments positions for each gram rather for the actual > token which can lead to rather funny problems especially with highlighting. > if this filter should be used for highlighting is a different story but today > this seems to be a common practice in many situations to highlight sub-term > matches. > I have a test for highlighting that uses ngram failing with a StringIOOB > since tokens are sorted by position which causes offsets to be mixed up due > to ngram token filter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org