: Caused by: java.lang.ClassCastException: <mypackage>.PayloadSimilarity : cannot be cast to org.apache.lucene.search.similarities.Similarity
If you are getting this error even though you subclass DefaultSimilarity, i suspect that one or both of the following has happened: 1) you've compiled your PayloadSimilarity against a different version of solr the lucene/solr jars then what you are running with 2) you've got multiple versions of the lucene similarity jars in your classpath at runtime. -Hoss http://www.lucidworks.com/