Where did BaseTokenFilterFactory go in Solr 4.0?

我的未来我决定 提交于 2019-12-22 08:27:18

问题


The Solr documentation for creating your own token and character filters says the following.

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Specifying_an_Analyzer_in_the_schema

If you want to use custom CharFilters, Tokenizers or TokenFilters, you'll need to write a very simple factory that subclasses BaseTokenizerFactory or BaseTokenFilterFactory, something like this...

public class MyCustomFilterFactory extends BaseTokenFilterFactory {
  public TokenStream create(TokenStream input) {
    return new MyCustomFilter(input);
  }
}

I cannot find the BaseTokenFilterFactory anywhere in the source code for Solr 4.

Here is the org.apache.solr.analysis package from Solr 3.6.1

http://svn.apache.org/viewvc/lucene/dev/tags/lucene_solr_3_6_1/solr/core/src/java/org/apache/solr/analysis/

And here is the same package for Solr 4.0.0

http://svn.apache.org/viewvc/lucene/dev/tags/lucene_solr_4_0_0/solr/core/src/java/org/apache/solr/analysis/

The documentation looks like it will work for Solr 3.6, but I need to know how to create custom filters using 4.0.


回答1:


With solr 4.0 the BaseTokenFilterFactory is now org.apache.lucene.analysis.util.TokenFilterFactory, so you can check on this.



来源:https://stackoverflow.com/questions/13149627/where-did-basetokenfilterfactory-go-in-solr-4-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!