Hi all,

I'm querying a recipe database in Solr. By using synonyms, I'm trying to
make my search a little smarter.

What I'm trying to do here, is that a search for pastry returns all lasagne,
penne & cannelloni recipes. 
However a search for lasagne should only return lasagne recipes.

In my synonyms.txt, I have these lines:
---------------------
lasagne,pastry
penne,pastry
cannelloni,pastry
---------------------

Filter in my scheme.xml looks like this:
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"
tokenizerFactory="solr.WhitespaceTokenizerFactory" /> 
Only in the index analyzer, not in the query.

When using the Solr analysis tool, I can see that my index for lasagne has a
synonym pastry and my query only queries lasagne. Same for penne and
cannelloni, they both have the synonym pastry.

Currently my Solr query for lasagne also returns all penne and cannelloni
recipes. I cannot understand why this is the case.

Can someone explain this behaviour to me please?







--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-synonyms-logic-tp4187827.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to