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


Java StandardAnalyzer.setVersion方法代码示例

本文整理汇总了Java中org.apache.lucene.analysis.standard.StandardAnalyzer.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java StandardAnalyzer.setVersion方法的具体用法?Java StandardAnalyzer.setVersion怎么用?Java StandardAnalyzer.setVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.analysis.standard.StandardAnalyzer的用法示例。


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

示例1: StandardAnalyzerProvider

import org.apache.lucene.analysis.standard.StandardAnalyzer; //导入方法依赖的package包/类
public StandardAnalyzerProvider(Index index, Settings indexSettings, Environment env, String name, Settings settings) {
    super(index, indexSettings, name, settings);
    this.esVersion = Version.indexCreated(indexSettings);
    final CharArraySet defaultStopwords;
    if (esVersion.onOrAfter(Version.V_1_0_0_Beta1)) {
        defaultStopwords = CharArraySet.EMPTY_SET;
    } else {
        defaultStopwords = StopAnalyzer.ENGLISH_STOP_WORDS_SET;
    }

    CharArraySet stopWords = Analysis.parseStopWords(env, settings, defaultStopwords);
    int maxTokenLength = settings.getAsInt("max_token_length", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
    standardAnalyzer = new StandardAnalyzer(stopWords);
    standardAnalyzer.setVersion(version);
    standardAnalyzer.setMaxTokenLength(maxTokenLength);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:StandardAnalyzerProvider.java

示例2: StandardAnalyzerProvider

import org.apache.lucene.analysis.standard.StandardAnalyzer; //导入方法依赖的package包/类
public StandardAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    final CharArraySet defaultStopwords = CharArraySet.EMPTY_SET;
    CharArraySet stopWords = Analysis.parseStopWords(env, indexSettings.getIndexVersionCreated(), settings, defaultStopwords);
    int maxTokenLength = settings.getAsInt("max_token_length", StandardAnalyzer.DEFAULT_MAX_TOKEN_LENGTH);
    standardAnalyzer = new StandardAnalyzer(stopWords);
    standardAnalyzer.setVersion(version);
    standardAnalyzer.setMaxTokenLength(maxTokenLength);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:StandardAnalyzerProvider.java

示例3: ChineseAnalyzerProvider

import org.apache.lucene.analysis.standard.StandardAnalyzer; //导入方法依赖的package包/类
public ChineseAnalyzerProvider(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    // old index: best effort
    analyzer = new StandardAnalyzer();
    analyzer.setVersion(version);
    
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:ChineseAnalyzerProvider.java

示例4: ChineseAnalyzerProvider

import org.apache.lucene.analysis.standard.StandardAnalyzer; //导入方法依赖的package包/类
@Inject
public ChineseAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    // old index: best effort
    analyzer = new StandardAnalyzer();
    analyzer.setVersion(version);
    
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:ChineseAnalyzerProvider.java


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