TokenFilterFactory is an interface. Your factory class  has to
implement this interface.

If you look at the Lucene factories, they all subclass from
BaseTokenFilterFactory which then subclasses from
BaseTokenStreamFactory. That last one does various things for the
child factories (I don't know what they are).

On Wed, Jul 7, 2010 at 5:29 AM, Martin Kysel <martin.ky...@univie.ac.at> wrote:
> Hi,
>
> I am trying to make a Lucene module for SKOS-based synonym expansion. As I
> wanted to implement the Filter in SOLR, I get a ClassCastException.
> So I tried to take one of the existing SOLR Filters and FilterFactories,
> change the package information, compress into a jar and use it as a plugin.
> But i get the same exception for classes that are SOLR's "own", if plugged
> in.
>
> java.lang.ClassCastException:
> at.ac.univie.mminf.luceneSKOS.solr.SynonymFilterFactory cannot be cast to
> org.apache.solr.analysis.TokenFilterFactory
>        at org.apache.solr.schema.IndexSchema$5.init(IndexSchema.java:777)
> .....
>
> If I define <filter class="solr.SynonymFilterFactory"/> in schema.xml it
> works,
> with <filter
> class="at.ac.univie.mminf.luceneSKOS.solr.SynonymFilterFactory"/> which is
> the same file I get an exception.
>
>
> I'm using the same dependencies as SOLR 1.4.1, because it caused problems
> with newer versions of lucene-core.
>
> Is there some step in plugging in new Filters I forgot?
>
> I am grateful for any suggestions or advice.
>
> Thank you,
>
> Martin
>
>



-- 
Lance Norskog
goks...@gmail.com

Reply via email to