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

Jack Krupansky commented on SOLR-4813:
--------------------------------------

The problem is not that you have a tokenizerFactory attribute, but that you are 
trying to use a tokenizer that has attributes. Solr is simply complaining that 
you have two attributes, maxGramSize and minGramSize that are not defined for 
the SynonymFilterFactory. Yes, that is a new feature in Solr! If your code was 
working in a previous release, you were lucky - it would have been using the 
default min and max of 1 and 1.

The synonym tokenizerFactory attribute has no provision for passing attributes 
to the synonym tokenizer. For now, you'll have to create a custom ngram 
tokenizer factor with the desired settings.

                
> Unavoidable IllegalArgumentException occurs when SynonymFilterFactory's 
> setting has tokenizer's parameter.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-4813
>                 URL: https://issues.apache.org/jira/browse/SOLR-4813
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 4.3
>            Reporter: Shingo Sasaki
>            Priority: Critical
>              Labels: SynonymFilterFactory
>
> When I write SynonymFilterFactory' setting in schema.xml as follows, ...
> {code:xml}
> <analyzer>
>   <tokenizer class="solr.NGramTokenizerFactory" maxGramSize="2" 
> minGramSize="2"/>
>   <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" 
> ignoreCase="true" expand="true"
>    tokenizerFactory="solr.NGramTokenizerFactory" maxGramSize="2" 
> minGramSize="2"/>
> </analyzer>
> {code}
> IllegalArgumentException ("Unknown parameters") occurs.
> {noformat}
> Caused by: java.lang.IllegalArgumentException: Unknown parameters: 
> {maxGramSize=2, minGramSize=2}
>       at 
> org.apache.lucene.analysis.synonym.FSTSynonymFilterFactory.<init>(FSTSynonymFilterFactory.java:71)
>       at 
> org.apache.lucene.analysis.synonym.SynonymFilterFactory.<init>(SynonymFilterFactory.java:50)
>       ... 28 more
> {noformat}
> However TokenizerFactory's params should be set to loadTokenizerFactory 
> method in [FST|Slow]SynonymFilterFactory. (ref. SOLR-2909)
> I think, the problem was caused by LUCENE-4877 ("Fix analyzer factories to 
> throw exception when arguments are invalid") and SOLR-3402 ("Parse Version 
> outside of Analysis Factories").

--
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

Reply via email to