當前位置: 首頁>>代碼示例>>Java>>正文


Java AnalysisModule.AnalysisProvider方法代碼示例

本文整理匯總了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;
}
 
開發者ID:Mangu-Singh-Rajpurohit,項目名稱:hinglish-stemmer,代碼行數:9,代碼來源:HinglishStemmerPlugin.java

示例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;
}
 
開發者ID:sing1ee,項目名稱:elasticsearch-jieba-plugin,代碼行數:10,代碼來源:AnalysisJiebaPlugin.java

示例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;
}
 
開發者ID:sing1ee,項目名稱:elasticsearch-jieba-plugin,代碼行數:10,代碼來源:AnalysisJiebaPlugin.java

示例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;
}
 
開發者ID:ginobefun,項目名稱:elasticsearch-dynamic-synonym,代碼行數:9,代碼來源:DynamicSynonymPlugin.java

示例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;
        }
    };
}
 
開發者ID:ginobefun,項目名稱:elasticsearch-dynamic-synonym,代碼行數:15,代碼來源:DynamicSynonymPlugin.java

示例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;
}
 
開發者ID:judasn,項目名稱:Elasticsearch-Tutorial-zh-CN,代碼行數:10,代碼來源:AnalysisIkPlugin.java

示例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);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:AnalysisRegistry.java

示例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;
        }
    };
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:AnalysisRegistry.java

示例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;
}
 
開發者ID:hualongdata,項目名稱:hanlp-ext,代碼行數:14,代碼來源:AnalysisHanLPPlugin.java

示例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;
}
 
開發者ID:hualongdata,項目名稱:hanlp-ext,代碼行數:8,代碼來源:AnalysisHanLPPlugin.java

示例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;
}
 
開發者ID:jaepil,項目名稱:mecab-ko-lucene-analyzer,代碼行數:11,代碼來源:AnalysisMeCabKoStandardPlugin.java

示例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;
}
 
開發者ID:gitchennan,項目名稱:elasticsearch-analysis-lc-pinyin,代碼行數:11,代碼來源:AnalysisLcPinyinPlugin.java

示例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;
}
 
開發者ID:gitchennan,項目名稱:elasticsearch-analysis-lc-pinyin,代碼行數:11,代碼來源:AnalysisLcPinyinPlugin.java


注:本文中的org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。