: *allergy test  =>  Doctors, Doctors-Medical, PHYSICIANS, Physicians &
: Surgeons
        ..
: <analyzer type="index">
        ...
: <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
: ignoreCase="true" expand="true"/>
        ...
: But when I do a search for allergy , I get 0 results

You've configured your field so that any time the terms "allergy" 
and "test" appear in sequence in a field value you index, those terms are 
removed and replaced by new terms ("Doctors", "Doctors-Medical", etc...)

So if the term "allergy" only appears in the source text followed by the 
term "test" then it will never actually be indexed in your document, so a 
serach for it will never match.

You can see this exact behavior in the screen shot you posted of the 
analysis tool...

: http://lucene.472066.n3.nabble.com/file/n3313862/Screenshot-1.png 

...after the synonyn filter, the term "allergy" is not in your indexed 
terms.

: when i change the synonym file to a comma separated I am able to see the
: results

because when using a comma instead of "=>" you are saying "if any of these 
term sequences exist, expand it to *all* of these term sequences.

Please note the docs on SYnonymFilter, particularly the examples...

https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory

-Hoss

Reply via email to