You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Spyros Kapnissis <sk...@yahoo.com> on 2011/06/01 10:59:32 UTC

Synonyms valid only in specific categories of data

Hello to all,


I have a collection of text phrases in more than 20 languages that I'm indexing 
in solr. Each phrase belongs to one of about 30 different phrase categories. I 
have specified different fields for each language and added a synonym filter at 
query time. I would however like the synonym filter to take into account the 
category as well. So, a specific synonym should be valid and used only in one or 
more categories per language. (the category is indexed in another field).  

Is this somehow possible in the current SynonymFilterFactory implementation? 

Hope it makes sense. 

Thank you,
Spyros

Re: Synonyms valid only in specific categories of data

Posted by Spyros Kapnissis <sk...@yahoo.com>.
Yes that would probably be a lot of fields.. I guess a way would be to extend the SynonymFilter and change the format of the synonyms.txt file to take the categories into account. 


Thanks again for your answer.



________________________________
From: lee carroll <le...@googlemail.com>
To: solr-user@lucene.apache.org
Sent: Wednesday, June 1, 2011 12:23 PM
Subject: Re: Synonyms valid only in specific categories of data

I don't think you can assign a synonyms file dynamically to a field.
you would need to create multiple fields for each lang / cat phrases
and have their own synonyms file referenced for each field. that would
be a lot of fields.....



On 1 June 2011 09:59, Spyros Kapnissis <sk...@yahoo.com> wrote:
> Hello to all,
>
>
> I have a collection of text phrases in more than 20 languages that I'm indexing
> in solr. Each phrase belongs to one of about 30 different phrase categories. I
> have specified different fields for each language and added a synonym filter at
> query time. I would however like the synonym filter to take into account the
> category as well. So, a specific synonym should be valid and used only in one or
> more categories per language. (the category is indexed in another field).
>
> Is this somehow possible in the current SynonymFilterFactory implementation?
>
> Hope it makes sense.
>
> Thank you,
> Spyros
>

Re: Synonyms valid only in specific categories of data

Posted by lee carroll <le...@googlemail.com>.
I don't think you can assign a synonyms file dynamically to a field.
you would need to create multiple fields for each lang / cat phrases
and have their own synonyms file referenced for each field. that would
be a lot of fields.....



On 1 June 2011 09:59, Spyros Kapnissis <sk...@yahoo.com> wrote:
> Hello to all,
>
>
> I have a collection of text phrases in more than 20 languages that I'm indexing
> in solr. Each phrase belongs to one of about 30 different phrase categories. I
> have specified different fields for each language and added a synonym filter at
> query time. I would however like the synonym filter to take into account the
> category as well. So, a specific synonym should be valid and used only in one or
> more categories per language. (the category is indexed in another field).
>
> Is this somehow possible in the current SynonymFilterFactory implementation?
>
> Hope it makes sense.
>
> Thank you,
> Spyros
>