Hi,

I'm trying to make solr use my custom similarity class:

import org.apache.lucene.search.DefaultSimilarity;

public class CustomSimilarity extends DefaultSimilarity {
}

but I keep getting this error:

com.example.CustomSimilarity cannot be cast to
org.apache.lucene.search.Similarity
    at org.apache.solr.schema.IndexSchema.readConfig(IndexSchema.java:449)
    ... 28 more

and in schema.xml I have this:
<similarity class="com.example.CustomSimilarity"/>

I even tried to extend Similarity directly just to make sure and it's not
working either. It means that it finds the class, it's able to instantiate
it but somehow it's not the right kind of object?!? What am I missing?

Thanks in advance,
Sebastien

Reply via email to