当前位置: 首页>>代码示例>>Java>>正文


Java SuggestStopFilter类代码示例

本文整理汇总了Java中org.apache.lucene.search.suggest.analyzing.SuggestStopFilter的典型用法代码示例。如果您正苦于以下问题:Java SuggestStopFilter类的具体用法?Java SuggestStopFilter怎么用?Java SuggestStopFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SuggestStopFilter类属于org.apache.lucene.search.suggest.analyzing包,在下文中一共展示了SuggestStopFilter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter; //导入依赖的package包/类
@Override
public TokenStream create(TokenStream tokenStream) {
    if (removeTrailing) {
        return new StopFilter(tokenStream, stopWords);
    } else {
        return new SuggestStopFilter(tokenStream, stopWords);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:StopTokenFilterFactory.java

示例2: testThatSuggestStopFilterWorks

import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter; //导入依赖的package包/类
public void testThatSuggestStopFilterWorks() throws Exception {
    Settings settings = Settings.builder()
            .put("index.analysis.filter.my_stop.type", "stop")
            .put("index.analysis.filter.my_stop.remove_trailing", false)
            .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString())
            .build();
    ESTestCase.TestAnalysis analysis = AnalysisTestsHelper.createTestAnalysisFromSettings(settings);
    TokenFilterFactory tokenFilter = analysis.tokenFilter.get("my_stop");
    assertThat(tokenFilter, instanceOf(StopTokenFilterFactory.class));
    Tokenizer tokenizer = new WhitespaceTokenizer();
    tokenizer.setReader(new StringReader("foo an"));
    TokenStream create = tokenFilter.create(tokenizer);
    assertThat(create, instanceOf(SuggestStopFilter.class));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:StopTokenFilterTests.java

示例3: create

import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter; //导入依赖的package包/类
@Override
public TokenStream create(TokenStream tokenStream) {
    if (removeTrailing) {
        if (version.onOrAfter(Version.LUCENE_4_4)) {
            return new StopFilter(tokenStream, stopWords);
        } else {
            return new Lucene43StopFilter(enablePositionIncrements, tokenStream, stopWords);
        }
    } else {
        return new SuggestStopFilter(tokenStream, stopWords);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:StopTokenFilterFactory.java

示例4: create

import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter; //导入依赖的package包/类
@Override
public TokenStream create(final TokenStream tokenStream) {
    if (removeTrailing) {
        return new StopFilter(tokenStream, stopWords);
    } else {
        return new SuggestStopFilter(tokenStream, stopWords);
    }
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-ja,代码行数:9,代码来源:JapaneseStopTokenFilterFactory.java


注:本文中的org.apache.lucene.search.suggest.analyzing.SuggestStopFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。