Hi, because your search for /?q=produto_nome:"lubrificante intimo" is a phrase search and will be handled different.
Your other search gets the synonyms, but the last synonym is a multi-word synonym and not a phrase ... produto_nome:lubrificante intimo) )) See also: http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory Regards Bernd Am 01.10.2012 19:02, schrieb Gustav: > Hello Everyone, > Im having a problem using the SynonymFilterFactory in a query analyzer. > > That's my synonyms.txt file: > > sexo => Preservativo, vaselina, viagra, lubrificante intimo > > And that is the fieldtype in which it is implemented: > > <fieldType class="solr.TextField" name="produto_nome_synonyms" > positionIncrementGap="100"> > <analyzer type="index"> > <tokenizer class="solr.StandardTokenizerFactory"/> > <filter class="solr.StopFilterFactory" > enablePositionIncrements="true" ignoreCase="true" words="stopwords.txt"/> > <filter class="solr.ISOLatin1AccentFilterFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.NGramFilterFactory" maxGramSize="25" > minGramSize="1"/> > </analyzer> > > <analyzer type="query"> > <tokenizer class="solr.StandardTokenizerFactory"/> > <filter class="solr.ISOLatin1AccentFilterFactory"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.SynonymFilterFactory" expand="true" > ignoreCase="true" synonyms="synonyms.txt" > tokenizerFactory="KeywordTokenizerFactory"/> > <filter class="solr.StopFilterFactory" > enablePositionIncrements="true" ignoreCase="true" words="stopwords.txt"/> > </analyzer> > </fieldType> > > The problem here is: > When i search for /?q=produto_nome:"lubrificante intimo" Solr returns 8 > documents, that matches because of the n-gram filter factory, but when i > search for /?q=produto_nome:"sexo" Solr brings no results. > I was expecting the same result as /?q="lubrificante intimo" , as configured > in the synonyms. > > i turned &debugQuery=true and got the following parsedquery: > > <str name="parsedquery"> > +DisjunctionMaxQuery(((produto_nome:preservativo produto_nome:vaselina > produto_nome:viagra produto_nome:lubrificante intimo) )) > </str> > > I Dont undersant why it brings no results. > Any ideas? > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Synonyms-Phrase-not-working-tp4011237.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- ************************************************************* Bernd Fehling Universitätsbibliothek Bielefeld Dipl.-Inform. (FH) LibTec - Bibliothekstechnologie Universitätsstr. 25 und Wissensmanagement 33615 Bielefeld Tel. +49 521 106-4060 bernd.fehling(at)uni-bielefeld.de BASE - Bielefeld Academic Search Engine - www.base-search.net *************************************************************