>
>
>>
> Hi Donald,
>
> Try to remove tokenizerFactory="**KeywordTokenizerFactory" in your
> synonym filter
> definition because I think you would want to tokenize the synonym settings
> in
> synonyms.txt as "floor" / "locker" => "storage" / "locker". But if you set
> it
> to KeywordTokenizer, it will be a map of "floor locker" => "storage
> locker", and as you
> are using WhitespaceTokenizer for your <tokenizer/> in <analyzer/>, then
> if you
> try to index "floor locker", it will be "floor"/"locker" (not "floor
> locker"),
> as a result, it will not match to your synonym map.
>
> Aside, I recommend that you would set <charFilter/> - <tokenizer/> -
> <filter/>
> chain in the natural order in <analyzer/>, though if those are wrong it
> won't
> be the cause of the problem at all.
>
>
>
OK so I have updated my schema.xml to the following:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100"
omitNorms="false">
          <analyzer type="index">
            <charFilter class="solr.HTMLStripCharFilterFactory"/>
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.SynonymFilterFactory"
synonyms="synonyms.txt" ignoreCase="true" expand="false"/>
            <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1" catenateWords="1"
catenateNumbers="1" catenateAll="0" />
            <filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
            <filter class="solr.EnglishPorterFilterFactory"
protected="protwords.txt" />
            <filter class="solr.LowerCaseFilterFactory" />
            <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
          </analyzer>
          .....

I am still getting results for storage locker  and no results for floor
locker

synonyms.txt still looks like this:

floor locker=>storage locker

Reply via email to