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

SynonymFilter fails when provided with optional tokenizerFactory

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0, 4.0.1, 4.1, 4.2
    • Fix Version/s: 4.1
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      Using the solr 4.0 example, if I add an optional tokenizerFactory ( as per http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory ) to the synonymFilter for the "text_general" field type:

      <filter class="solr.SynonymFilterFactory"
      synonyms="synonyms.txt"
      tokenizerFactory="solr.StandardTokenizerFactory"
      ignoreCase="true"
      expand="true"/>

      I receive the error at startup:

      SEVERE: null:java.lang.IllegalArgumentException: Configuration Error: Factory 'org.apache.lucene.analysis.standard.StandardTokenizerFactory' needs a 'luceneMatchVersion' parameter

      It also fails if I try adding the param luceneMatchVersion="LUCENE_40" :

      <filter class="solr.SynonymFilterFactory"
      synonyms="synonyms.txt"
      tokenizerFactory="solr.StandardTokenizerFactory"
      luceneMatchVersion="LUCENE_40"
      ignoreCase="true"
      expand="true"/>

      ----------

      It looks like the delegator in the SynonymFilterFactory is not propagating the LUCENE_MATCH_VERSION to the tokenizer. For tokenizers that don't require a match version (whitespace) everything works correctly. This issue seems to be a problem in the 4x branch... trunk removes the code that delegates between the 2 types of synonym filters.

        Attachments

        1. SOLR-4251.patch
          5 kB
          Chris Bleakley

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bleakley Chris Bleakley
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: