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 Will Milspec <wi...@gmail.com> on 2010/11/03 18:07:30 UTC

Override SynonymFilterFactory to load synonyms from alternate data source

Hi all,

Can anyone comment on the ease/merit of overriding the shipped
SynonymFilterFactory with a version that could load the synonyms from an
alternate data source?

Our application currently maintains synonyms in its database ; we could
export this data to 'synonyms.txt', but would prefer a db aware
implementationv of SynonymFilterFactory, i.e. avoiding that middle step.

>From the looks of the class (private instances, static methods), it doesn't
lend itself to easy subclassing..

Any comments or recommendations?

thanks

will

Re: Override SynonymFilterFactory to load synonyms from alternate data source

Posted by Ahmet Arslan <io...@yahoo.com>.
> Our application currently maintains synonyms in its
> database ; we could
> export this data to 'synonyms.txt', but would prefer a db
> aware
> implementationv of SynonymFilterFactory, i.e. avoiding that
> middle step.
> 
> From the looks of the class (private instances, static
> methods), it doesn't
> lend itself to easy subclassing..

"just write your own DataBaseSynonymFilterFactory 
that loads the synonyms from your db using your custom logic and then 
constructs the SynonymFilter objects like the existing factory" [1]

[1] http://search-lucene.com/m/Av4xC1PtNLW1/