本文整理匯總了Java中org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider方法的典型用法代碼示例。如果您正苦於以下問題:Java AnalysisModule.AnalysisProvider方法的具體用法?Java AnalysisModule.AnalysisProvider怎麽用?Java AnalysisModule.AnalysisProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.elasticsearch.indices.analysis.AnalysisModule
的用法示例。
在下文中一共展示了AnalysisModule.AnalysisProvider方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTokenFilters
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> getTokenFilters()
{
Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> dictOut = new LinkedHashMap<>();
dictOut.put("hinglish-token-filter", HinglishTokenFilterFactory::new);
return dictOut;
}
示例2: getTokenizers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> getTokenizers() {
Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> extra = new HashMap<>();
extra.put("jieba_search", JiebaTokenizerFactory::getJiebaSearchTokenizerFactory);
extra.put("jieba_index", JiebaTokenizerFactory::getJiebaIndexTokenizerFactory);
return extra;
}
示例3: getAnalyzers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的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;
}
示例4: getTokenFilters
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> tokenFilters = new HashMap<>();
tokenFilters.put(PLUGIN_NAME, requiresAnalysisSettings((is, env, name, settings) -> new DynamicSynonymTokenFilterFactory(is, env, name, settings)));
return tokenFilters;
}
示例5: requiresAnalysisSettings
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
private <T> AnalysisModule.AnalysisProvider<T> requiresAnalysisSettings(AnalysisModule.AnalysisProvider<T> provider) {
return new AnalysisModule.AnalysisProvider<T>() {
@Override
public T get(IndexSettings indexSettings, Environment environment, String name, Settings settings) throws IOException {
return provider.get(indexSettings, environment, name, settings);
}
@Override
public boolean requiresAnalysisSettings() {
return true;
}
};
}
示例6: getAnalyzers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的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;
}
示例7: buildTokenFilterFactories
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
public Map<String, TokenFilterFactory> buildTokenFilterFactories(IndexSettings indexSettings) throws IOException {
final Map<String, Settings> tokenFiltersSettings = indexSettings.getSettings().getGroups(INDEX_ANALYSIS_FILTER);
Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> tokenFilters = new HashMap<>(this.tokenFilters);
/*
* synonym and synonym_graph are different than everything else since they need access to the tokenizer factories for the index.
* instead of building the infrastructure for plugins we rather make it a real exception to not pollute the general interface and
* hide internal data-structures as much as possible.
*/
tokenFilters.put("synonym", requiresAnalysisSettings((is, env, name, settings) -> new SynonymTokenFilterFactory(is, env, this, name, settings)));
tokenFilters.put("synonym_graph", requiresAnalysisSettings((is, env, name, settings) -> new SynonymGraphTokenFilterFactory(is, env, this, name, settings)));
return buildMapping(Component.FILTER, indexSettings, tokenFiltersSettings, Collections.unmodifiableMap(tokenFilters), prebuiltAnalysis.tokenFilterFactories);
}
示例8: requiresAnalysisSettings
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
private static <T> AnalysisModule.AnalysisProvider<T> requiresAnalysisSettings(AnalysisModule.AnalysisProvider<T> provider) {
return new AnalysisModule.AnalysisProvider<T>() {
@Override
public T get(IndexSettings indexSettings, Environment environment, String name, Settings settings) throws IOException {
return provider.get(indexSettings, environment, name, settings);
}
@Override
public boolean requiresAnalysisSettings() {
return true;
}
};
}
示例9: getTokenizers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> getTokenizers() {
HashMap<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> tokenizers = new HashMap<>();
tokenizers.put("hanlp", HanLPTokenizerFactory::createStandard);
tokenizers.put("hanlp-standard", HanLPTokenizerFactory::createStandard);
tokenizers.put("hanlp-nlp", HanLPTokenizerFactory::createNLP);
tokenizers.put("hanlp-index", HanLPIndexAnalyzerFactory::new);
tokenizers.put("hanlp-nshort", HanLPTokenizerFactory::createNShort);
tokenizers.put("hanlp-shortest", HanLPTokenizerFactory::createShortest);
tokenizers.put("hanlp-crf", HanLPTokenizerFactory::createCRF);
tokenizers.put("hanlp-speed", HanLPTokenizerFactory::createSpeed);
return tokenizers;
}
示例10: getAnalyzers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> analyzers = new HashMap<>();
analyzers.put("hanlp", HanLPAnalyzerProvider::new);
analyzers.put("hanlp-index", HanLPIndexAnalyzerProvider::new);
return analyzers;
}
示例11: getCharFilters
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<CharFilterFactory>> getCharFilters() {
Map<String, AnalysisModule.AnalysisProvider<CharFilterFactory>> factories = new HashMap<>();
factories.put("chinese-simplifying",
(indexSettings, environment, name, settings) ->
new ChineseSimplifyingCharFilterFactory(indexSettings, name));
return factories;
}
開發者ID:dowenliu-xyz,項目名稱:elasticsearch-analysis-char-filter-chinese-simplifying,代碼行數:11,代碼來源:AnalysisChineseSimplifyingPlugin.java
示例12: getTokenizers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> getTokenizers() {
Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> tokenizers = new HashMap<>();
tokenizers.put("mecab_ko_standard_tokenizer", MeCabKoStandardTokenizerFactory::new);
tokenizers.put("mecab_ko_similarity_measure_tokenizer", MeCabKoSimilarityMeasureTokenizerFactory::new);
tokenizers.put("mecab_ko_keyword_search_tokenizer", MeCabKoKeywordSearchTokenizerFactory::new);
return tokenizers;
}
示例13: getTokenFilters
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> getTokenFilters() {
Map<String, AnalysisModule.AnalysisProvider<TokenFilterFactory>> factories = new HashMap<>();
factories.put("pinyin", (indexSettings, environment, name, settings) -> new PinyinTokenFilterFactory(indexSettings, name, settings));
return factories;
}
開發者ID:dowenliu-xyz,項目名稱:elasticsearch-analysis-token-filter-pinyin,代碼行數:9,代碼來源:AnalysisPinyinPlugin.java
示例14: getTokenizers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的package包/類
@Override
public Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> getTokenizers() {
Map<String, AnalysisModule.AnalysisProvider<TokenizerFactory>> providerMap
= new HashMap<String, AnalysisModule.AnalysisProvider<TokenizerFactory>>();
providerMap.put("lc_index", LcPinyinTokenizerFactory::getLcIndexTokenizerFactory);
providerMap.put("lc_search", LcPinyinTokenizerFactory::getLcSmartPinyinTokenizerFactory);
return providerMap;
}
示例15: getAnalyzers
import org.elasticsearch.indices.analysis.AnalysisModule; //導入方法依賴的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;
}