Multi-word synonyms are meant to be used at index time. QueryParser will split your query on white spaces unless you use quotes.
"The Lucene QueryParser tokenizes on white space before giving any text to the Analyzer...." [1] [1]http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory --- On Mon, 11/15/10, sivaprasad <sivaprasa...@echidnainc.com> wrote: > From: sivaprasad <sivaprasa...@echidnainc.com> > Subject: Problem with synonyms > To: solr-user@lucene.apache.org > Date: Monday, November 15, 2010, 5:24 PM > > Hi, > > I have a set of synonyms in synonyms.txt file. > > For ex: > hdtv,High Definition Television, High Definition TV > > > In the admin screen when i type "High Definition > Television" as the query > term to analyze , i got hdtv as the result of the > analysis. > > But when is search for the term hdtv and "High Definition > Television" the > results count is mismatching. > > The analysis chain is given below > > <fieldType name="text" class="solr.TextField" > positionIncrementGap="100"> > <analyzer> > <tokenizer > class="solr.WhitespaceTokenizerFactory"/> > <filter > class="solr.SynonymFilterFactory" synonyms="synonyms.txt" > ignoreCase="true" expand="true"/> > > <filter > class="solr.StopFilterFactory" ignoreCase="true" > words="stopwords.txt"/> > <filter > class="solr.LowerCaseFilterFactory"/> > <filter > class="solr.EnglishPorterFilterFactory" > protected="protwords.txt"/> > <filter > class="solr.RemoveDuplicatesTokenFilterFactory"/> > </analyzer> > > </fieldType> > > As part of search results i enabled debugQuery=true and > then the query term > is coming as shown below. > > +searchtext:high +searchtext:definit +searchtext:televis > > But if i put the query term in double quotes(for ex:"High > Definition > Television") , it is working fine. > > What is the cause for this problem? > > Regards, > Siva > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Problem-with-synonyms-tp1905051p1905051.html > Sent from the Solr - User mailing list archive at > Nabble.com. >