本文整理汇总了Java中org.elasticsearch.index.analysis.AnalyzerProvider类的典型用法代码示例。如果您正苦于以下问题:Java AnalyzerProvider类的具体用法?Java AnalyzerProvider怎么用?Java AnalyzerProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnalyzerProvider类属于org.elasticsearch.index.analysis包,在下文中一共展示了AnalyzerProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> extra = new HashMap<>();
extra.put("jieba_search", JiebaAnalyzerProvider::getJiebaSearchAnalyzerProvider);
extra.put("jieba_index", JiebaAnalyzerProvider::getJiebaIndexAnalyzerProvider);
return extra;
}
示例2: AnalysisModule
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
public AnalysisModule(Environment environment, List<AnalysisPlugin> plugins) throws IOException {
NamedRegistry<AnalysisProvider<CharFilterFactory>> charFilters = setupCharFilters(plugins);
NamedRegistry<org.apache.lucene.analysis.hunspell.Dictionary> hunspellDictionaries = setupHunspellDictionaries(plugins);
hunspellService = new HunspellService(environment.settings(), environment, hunspellDictionaries.getRegistry());
NamedRegistry<AnalysisProvider<TokenFilterFactory>> tokenFilters = setupTokenFilters(plugins, hunspellService);
NamedRegistry<AnalysisProvider<TokenizerFactory>> tokenizers = setupTokenizers(plugins);
NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> analyzers = setupAnalyzers(plugins);
NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> normalizers = setupNormalizers(plugins);
analysisRegistry = new AnalysisRegistry(environment, charFilters.getRegistry(), tokenFilters.getRegistry(), tokenizers
.getRegistry(), analyzers.getRegistry(), normalizers.getRegistry());
}
示例3: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> extra = new HashMap<>();
extra.put("ik_smart", IkAnalyzerProvider::getIkSmartAnalyzerProvider);
extra.put("ik_max_word", IkAnalyzerProvider::getIkAnalyzerProvider);
return extra;
}
示例4: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> providerMap
= new HashMap<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>>();
providerMap.put("lc_index", LcPinyinAnalyzerProvider::getIndexAnalyzerProvider);
providerMap.put("lc_search", LcPinyinAnalyzerProvider::getSmartPinyinAnalyzerProvider);
return providerMap;
}
示例5: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> retMap = new HashMap<>();
for (Config.AnalysisConfig ca : config.getSegmentConfig()) {
final Segment segment = ca.createSegment(config.getCjkLexicon());
retMap.put(segment.getName(), (indexSettings, environment, name, settings) -> new AbstractIndexAnalyzerProvider(indexSettings, name, settings) {
@Override
public Analyzer get() {
return new BenzAnalyzer(config, segment);
}
});
}
return retMap;
}
示例6: newDocumentMapperParser
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
public static DocumentMapperParser newDocumentMapperParser(Settings customSettings, String index) throws IOException {
Settings settings = Settings.builder()
.put("path.home", System.getProperty("path.home", System.getProperty("user.dir")))
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
.put(customSettings)
.build();
Environment environment = new Environment(settings);
ReferencePlugin referencePlugin = new ReferencePlugin();
AnalysisModule analysisModule = new AnalysisModule(environment, Collections.emptyList());
IndicesModule indicesModule = new IndicesModule(Collections.singletonList(referencePlugin));
MapperRegistry mapperRegistry = indicesModule.getMapperRegistry();
AnalysisRegistry analysisRegistry = analysisModule.getAnalysisRegistry();
IndexMetaData indexMetaData = IndexMetaData.builder(index)
.settings(settings)
.numberOfShards(1)
.numberOfReplicas(1)
.build();
IndexSettings indexSettings = new IndexSettings(indexMetaData, settings);
SimilarityService similarityService = new SimilarityService(indexSettings, SimilarityService.BUILT_IN);
Map<String, CharFilterFactory> charFilterFactoryMap = analysisRegistry.buildCharFilterFactories(indexSettings);
Map<String, TokenFilterFactory> tokenFilterFactoryMap = analysisRegistry.buildTokenFilterFactories(indexSettings);
Map<String, TokenizerFactory> tokenizerFactoryMap = analysisRegistry.buildTokenizerFactories(indexSettings);
Map<String, AnalyzerProvider<?>> analyzerProviderMap = analysisRegistry.buildAnalyzerFactories(indexSettings);
Map<String, AnalyzerProvider<?>> normalizerProviderMap = analysisRegistry.buildNormalizerFactories(indexSettings);
IndexAnalyzers indexAnalyzers = analysisRegistry.build(indexSettings,
analyzerProviderMap,
normalizerProviderMap,
tokenizerFactoryMap,
charFilterFactoryMap,
tokenFilterFactoryMap);
MapperService mapperService = new MapperService(indexSettings, indexAnalyzers, NamedXContentRegistry.EMPTY,
similarityService, mapperRegistry, null);
return new DocumentMapperParser(indexSettings, mapperService, indexAnalyzers, NamedXContentRegistry.EMPTY,
similarityService, mapperRegistry, null);
}
示例7: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> extra = new LinkedHashMap<>();
if (settings.getAsBoolean("plugins.xbib.icu.enabled", true)) {
extra.put("icu_collation", IcuCollationKeyAnalyzerProvider::new);
}
extra.put("hyphen", HyphenAnalyzerProvider::new);
extra.put("naturalsort", NaturalSortKeyAnalyzerProvider::new);
extra.put("sortform", SortformAnalyzerProvider::new);
extra.put("standardnumber", (indexSettings, environment, name, factorySettings) ->
new StandardnumberAnalyzerProvider(indexSettings, environment, name, factorySettings, standardNumberTypeParser));
return extra;
}
示例8: newDocumentMapperParser
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
public static DocumentMapperParser newDocumentMapperParser(Settings customSettings, String index) throws IOException {
Settings settings = Settings.builder()
.put("path.home", System.getProperty("path.home", "/tmp"))
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
.put(customSettings)
.build();
Environment environment = new Environment(settings);
BundlePlugin bundlePlugin = new BundlePlugin(settings);
AnalysisModule analysisModule = new AnalysisModule(environment, Collections.singletonList(bundlePlugin));
IndicesModule indicesModule = new IndicesModule(Collections.singletonList(bundlePlugin));
MapperRegistry mapperRegistry = indicesModule.getMapperRegistry();
AnalysisRegistry analysisRegistry = analysisModule.getAnalysisRegistry();
IndexMetaData indexMetaData = IndexMetaData.builder(index)
.settings(settings)
.numberOfShards(1)
.numberOfReplicas(1)
.build();
IndexSettings indexSettings = new IndexSettings(indexMetaData, settings);
SimilarityService similarityService = new SimilarityService(indexSettings, SimilarityService.BUILT_IN);
Map<String, CharFilterFactory> charFilterFactoryMap = analysisRegistry.buildCharFilterFactories(indexSettings);
Map<String, TokenFilterFactory> tokenFilterFactoryMap = analysisRegistry.buildTokenFilterFactories(indexSettings);
Map<String, TokenizerFactory> tokenizerFactoryMap = analysisRegistry.buildTokenizerFactories(indexSettings);
Map<String, AnalyzerProvider<?>> analyzerProviderMap = analysisRegistry.buildAnalyzerFactories(indexSettings);
Map<String, AnalyzerProvider<?>> normalizerProviderMap = analysisRegistry.buildNormalizerFactories(indexSettings);
IndexAnalyzers indexAnalyzers = analysisRegistry.build(indexSettings,
analyzerProviderMap,
normalizerProviderMap,
tokenizerFactoryMap,
charFilterFactoryMap,
tokenFilterFactoryMap);
MapperService mapperService = new MapperService(indexSettings, indexAnalyzers, NamedXContentRegistry.EMPTY,
similarityService, mapperRegistry, null);
return new DocumentMapperParser(indexSettings, mapperService, indexAnalyzers, NamedXContentRegistry.EMPTY,
similarityService, mapperRegistry, null);
}
示例9: setupAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
private NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> setupAnalyzers(List<AnalysisPlugin> plugins) {
NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> analyzers = new NamedRegistry<>("analyzer");
analyzers.register("default", StandardAnalyzerProvider::new);
analyzers.register("standard", StandardAnalyzerProvider::new);
analyzers.register("standard_html_strip", StandardHtmlStripAnalyzerProvider::new);
analyzers.register("simple", SimpleAnalyzerProvider::new);
analyzers.register("stop", StopAnalyzerProvider::new);
analyzers.register("whitespace", WhitespaceAnalyzerProvider::new);
analyzers.register("keyword", KeywordAnalyzerProvider::new);
analyzers.register("pattern", PatternAnalyzerProvider::new);
analyzers.register("snowball", SnowballAnalyzerProvider::new);
analyzers.register("arabic", ArabicAnalyzerProvider::new);
analyzers.register("armenian", ArmenianAnalyzerProvider::new);
analyzers.register("basque", BasqueAnalyzerProvider::new);
analyzers.register("brazilian", BrazilianAnalyzerProvider::new);
analyzers.register("bulgarian", BulgarianAnalyzerProvider::new);
analyzers.register("catalan", CatalanAnalyzerProvider::new);
analyzers.register("chinese", ChineseAnalyzerProvider::new);
analyzers.register("cjk", CjkAnalyzerProvider::new);
analyzers.register("czech", CzechAnalyzerProvider::new);
analyzers.register("danish", DanishAnalyzerProvider::new);
analyzers.register("dutch", DutchAnalyzerProvider::new);
analyzers.register("english", EnglishAnalyzerProvider::new);
analyzers.register("finnish", FinnishAnalyzerProvider::new);
analyzers.register("french", FrenchAnalyzerProvider::new);
analyzers.register("galician", GalicianAnalyzerProvider::new);
analyzers.register("german", GermanAnalyzerProvider::new);
analyzers.register("greek", GreekAnalyzerProvider::new);
analyzers.register("hindi", HindiAnalyzerProvider::new);
analyzers.register("hungarian", HungarianAnalyzerProvider::new);
analyzers.register("indonesian", IndonesianAnalyzerProvider::new);
analyzers.register("irish", IrishAnalyzerProvider::new);
analyzers.register("italian", ItalianAnalyzerProvider::new);
analyzers.register("latvian", LatvianAnalyzerProvider::new);
analyzers.register("lithuanian", LithuanianAnalyzerProvider::new);
analyzers.register("norwegian", NorwegianAnalyzerProvider::new);
analyzers.register("persian", PersianAnalyzerProvider::new);
analyzers.register("portuguese", PortugueseAnalyzerProvider::new);
analyzers.register("romanian", RomanianAnalyzerProvider::new);
analyzers.register("russian", RussianAnalyzerProvider::new);
analyzers.register("sorani", SoraniAnalyzerProvider::new);
analyzers.register("spanish", SpanishAnalyzerProvider::new);
analyzers.register("swedish", SwedishAnalyzerProvider::new);
analyzers.register("turkish", TurkishAnalyzerProvider::new);
analyzers.register("thai", ThaiAnalyzerProvider::new);
analyzers.register("fingerprint", FingerprintAnalyzerProvider::new);
analyzers.extractAndRegister(plugins, AnalysisPlugin::getAnalyzers);
return analyzers;
}
示例10: setupNormalizers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
private NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> setupNormalizers(List<AnalysisPlugin> plugins) {
NamedRegistry<AnalysisProvider<AnalyzerProvider<?>>> normalizers = new NamedRegistry<>("normalizer");
// TODO: provide built-in normalizer providers?
// TODO: pluggability?
return normalizers;
}
示例11: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
/**
* Override to add additional {@link Analyzer}s.
*/
default Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
return emptyMap();
}
示例12: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
return singletonMap("dummy", (a, b, c, d) -> new DummyAnalyzerProvider());
}
示例13: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
return singletonMap("polish", PolishAnalyzerProvider::new);
}
示例14: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
return singletonMap("ukrainian", UkrainianAnalyzerProvider::new);
}
示例15: getAnalyzers
import org.elasticsearch.index.analysis.AnalyzerProvider; //导入依赖的package包/类
@Override
public Map<String, AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
return singletonMap("smartcn", SmartChineseAnalyzerProvider::new);
}