本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}