I am running into a somewhat similar issue with Synonyms. I'm trying to
create a synonym filter for common first names (ie: chuck,charles,charlie).
Here is a snippet from my schema.xml:
<fieldtype name="firstname" class="solr.StrField">
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory"
synonyms="/srv/solr/solr/conf/firstname_synonyms.txt" ignoreCase="true"
expand="true"/>
</analyzer>
</fieldtype>
...
<field name="firstname_fuzzy_s" type="firstname" indexed="true"
stored="false" omitNorms="true"/>
Here's a piece of my synonyms file:
Abraham,Abe,Abram,Bram
Adaline,Ada,Adela,Aline,Edith
Adam,Ade,Edie
Now, when I use the Field Analyzer, everything works as expected. There is
a match from the index value of "Abraham" and the query value of "abe".
However, when I try it in a query I get 0 results. Even when I query for
"abraham" I get 0 results even though there are many Abrahams indexed. If I
query for names that do not have synonyms, I get results. It seems that the
synonym filter is breaking my queries.
I'm starting to think there's something obvious I'm not doing wrong.
Thanks,
ben
beejenny wrote:
>
> I created a "JustSynonyms" field type that is configured to use the
> WhiteSpaceTokenizer and the SynonymFilterFactory.
>
> I think I might have cracked it:
>
> In my synonyms.txt I now have:
>
> Yellow, Buttermilk, Mustard, Pineapple, Straw, Sunshine
> Red, Cranberry, Crimson, Dark Red, Strawberry, Scarlet
> ...
>
> Without using the "=>" symbol and setting "expand = true" on the
> SynonymFilter I now get buttermilk, mustard etc. when I search on
> "Yellow".
>
> Many thanks for your reply
>
> Jenny
>
>
>
> Pieter Berkel wrote:
>>
>> What is the fieldType of your Colour field? You must ensure that the
>> particular field that you are using to store Colour information is
>> configured to use solr.SynonymFilterFactory in your schema.xml
>> configuration
>> file.
>>
>> cheers,
>> Piete
>>
>>
>> On 07/08/07, beejenny <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> Hello,
>>>
>>> I am trying to configure some synonyms against an index of catalog
>>> products
>>> and I can't seem to get it right.
>>>
>>> We are indexing a field called Colour which contains the colour of a
>>> product. Some of the values for colour are a little obscure and we'd
>>> like
>>> to map them to more common colours.
>>>
>>> For example
>>> Straw, Melon, Buttermilk, Mustard => Yellow
>>> Navy, Ocean, cobalt => Blue
>>>
>>> When I search for q=Colour:Yellow I would like to bring back all the
>>> documents with colour of yellow, Straw, Melon, Buttermilk and Mustard.
>>>
>>> Effectively
>>> q=Colour:Yellow+Colour:Straw+Colour:Melon+Colour:Buttermilk+Colour:Mustard
>>>
>>> But no matter what I do I only get back products with "Yellow" in the
>>> colour
>>> field. Is using synonyms the best way to try to achieve this?
>>>
>>> Any pointers would be greatly appreciated.
>>>
>>> Jenny
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Configuring-Synonyms-tf4229295.html#a12031632
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Configuring-Synonyms-tf4229295.html#a12037306
Sent from the Solr - User mailing list archive at Nabble.com.