Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4813

Unavoidable IllegalArgumentException occurs when SynonymFilterFactory's setting has tokenizer factory's parameter.

    XMLWordPrintableJSON

Details

    Description

      When I write SynonymFilterFactory' setting in schema.xml as follows, ...

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

      IllegalArgumentException ("Unknown parameters") occurs.

      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
      

      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").

      Attachments

        1. SOLR-4813.patch
          6 kB
          Shingo Sasaki
        2. SOLR-4813.patch
          7 kB
          Chris M. Hostetter
        3. SOLR-4813__4x.patch
          27 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              sasashin Shingo Sasaki
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: