lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peyman Faratin <pey...@robustlinks.com>
Subject KeywordTokenizerFactory with SynonymFilterFactory
Date Sat, 16 Jun 2012 22:09:00 GMT
Hi

I have the following 2 field types

<fieldType name="tokenizer1" class="solr.TextField" sortMissingLast="true" autoGeneratePhraseQueries="true">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="false"
expand="true"/> 
      	<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
</fieldType>


<fieldType name="tokenizer2" class="solr.TextField" sortMissingLast="true" autoGeneratePhraseQueries="true">
      <analyzer type="index">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.KeywordTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="false"
expand="true"/> 
      </analyzer>
</fieldType>	

The problem I am seeing is if I have an entry as this in the "synonyms.txt" file

helping hand => assistance

then issuing "helping hand" query (with dismax) to the field tokenized with tokenizer1 returns
the correct query ("assistance") whereas there is no synonym mapping for tokenizer2 (confirmed
in Solr admin panel). 

Am I doing something wrong?

thank you



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message