下面列出了怎么用org.hibernate.search.backend.elasticsearch.analysis.ElasticsearchAnalysisConfigurationContext的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public void configure(ElasticsearchAnalysisConfigurationContext context) {
context.analyzer("name").custom()
.tokenizer("standard")
.tokenFilters("asciifolding", "lowercase");
context.analyzer("english").custom()
.tokenizer("standard")
.tokenFilters("asciifolding", "lowercase", "porter_stem");
context.normalizer("sort").custom()
.tokenFilters("asciifolding", "lowercase");
}
@Override
public void configure(ElasticsearchAnalysisConfigurationContext context) {
context.analyzer( "cleaned_text" ).custom()
.tokenizer( "whitespace" )
.charFilters( "html_strip" )
.tokenFilters( "asciifolding", "lowercase", "stop", "porter_stem" );
context.normalizer( "cleaned_keyword" ).custom()
.tokenFilters( "asciifolding", "lowercase" );
}
@Override
public void configure(ElasticsearchAnalysisConfigurationContext context) {
context.analyzer( "english" ).custom()
.tokenizer( "standard" )
.tokenFilters( "lowercase", "stemmer_english", "asciifolding" );
context.tokenFilter( "stemmer_english" )
.type( "stemmer" )
.param( "language", "english" );
}
@Override
public void configure(ElasticsearchAnalysisConfigurationContext context) {
context.analyzer("standard").type("standard");
context.normalizer("lowercase").custom().tokenFilters("lowercase");
}