You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tim Allison (JIRA)" <ji...@apache.org> on 2018/02/14 13:24:02 UTC

[jira] [Commented] (SOLR-11976) TokenizerChain is overwriting, not chaining TokenFilters in normalize()

    [ https://issues.apache.org/jira/browse/SOLR-11976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16364010#comment-16364010 ] 

Tim Allison commented on SOLR-11976:
------------------------------------

Better yet, swap out Solr's {{TokenizerChain}} for Lucene's {{CustomAnalyzer}} and deprecate {{TokenizerChain}} in 7.x?

Happy to submit PR if a committer is willing to work with me on this.

> TokenizerChain is overwriting, not chaining TokenFilters in normalize()
> -----------------------------------------------------------------------
>
>                 Key: SOLR-11976
>                 URL: https://issues.apache.org/jira/browse/SOLR-11976
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: search
>    Affects Versions: master (8.0)
>            Reporter: Tim Allison
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> TokenizerChain is overwriting, not chaining tokenfilters in {{normalize}}.  
> This doesn't currently break search because {{normalize}} is not being used at the Solr level (AFAICT); rather, TextField has its own {{analyzeMultiTerm()}} that duplicates code from the newer {{normalize}}. 
> Code as is:
> {noformat}
>     TokenStream result = in;
>     for (TokenFilterFactory filter : filters) {
>       if (filter instanceof MultiTermAwareComponent) {
>         filter = (TokenFilterFactory) ((MultiTermAwareComponent) filter).getMultiTermComponent();
>         result = filter.create(in);
>       }
>     }
> {noformat}
> The fix is simple:
> {noformat}
> -        result = filter.create(in);
> +        result = filter.create(result);
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org