java - How to load custom similarity class into Solr 4.4 -
i trying deploy custom similarity class solr 4.4 on cloudera cluster. here code:
package org.apache.lucene.search.similarities; import org.apache.lucene.index.fieldinvertstate; import org.apache.lucene.search.similarities.defaultsimilarity; public class mynewsimilarityclass extends defaultsimilarity { @override public float idf(long docfreq, long numdocs) { return 1.0f; } }
i found similar question: solr custom similarity, have additional concerns.
- should compile errors? or include solr jars buildpath?
- where should store created jar? $instancedir/lib ok?
- is solr restart required make solr "see" class?
what changes should make in schema.xml? have added fieldtype:
<similarity class="org.apache.lucene.search.similarities.mynewsimilarityclass" />
and changed globally other fields:
<similarity class="solr.schemasimilarityfactory"/>
when trying reindex collection, receiving following error:
error: org.apache.solr.common.solrexception: plugin init failure [schema.xml] fieldtype "text_wiki": error loading class 'org.apache.lucene.search.similarities.mynewsimilarityclass'
Comments
Post a Comment