I'm using 4.10.3 solr and after I implemented Factory with Filter
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.util.TokenFilterFactory;
import java.util.Map;
public class CustomFilterFactory extends TokenFilterFactory {
protected CustomFilterFactory(Map<String, String> args) {
super(args);
}
@Override
public TokenStream create(TokenStream tokenStream) {
return new CustomFilter(tokenStream);
}
}
and when Solr starts, I'm getting strange errors in log:
Caused by:
java.lang.ClassCastException: class org.apache.lucene.analysis.tr.ApostropheFilterFactory
at java.lang.Class.asSubclass(Class.java:3116)
at org.apache.lucene.util.SPIClassIterator.next(SPIClassIterator.java:141)
at org.apache.lucene.analysis.util.AnalysisSPILoader.reload(AnalysisSPILoader.java:79)
at org.apache.lucene.analysis.util.AnalysisSPILoader.<init>(AnalysisSPILoader.java:60)
at org.apache.lucene.analysis.util.AnalysisSPILoader.<init>(AnalysisSPILoader.java:49)
at org.apache.lucene.analysis.util.TokenFilterFactory.<clinit>(TokenFilterFactory.java:31)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:474)
at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:593)
at org.apache.solr.schema.FieldTypePluginLoader$1.create(FieldTypePluginLoader.java:306)
at org.apache.solr.schema.FieldTypePluginLoader$1.create(FieldTypePluginLoader.java:299)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
at org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:325)
at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:486)
Any idea what could cause this state?
Field definition:
<field name="ii" type="customFilter" indexed="true" stored="false" required="false" multiValued="false"/>
<fieldType name="customFilter" class="solr.TextField">
<analyzer>
<charFilter class="com.nosql.search.solr.CustomFilterFactory" />
</analyzer>
</fieldType>
I'm using same Java version for my custom jar with filter and for starting Solr.
It works if I remove the reference to CustomFilterFactory.