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


Java AnalysisModule類代碼示例

本文整理匯總了Java中org.elasticsearch.index.analysis.AnalysisModule的典型用法代碼示例。如果您正苦於以下問題:Java AnalysisModule類的具體用法?Java AnalysisModule怎麽用?Java AnalysisModule使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AnalysisModule類屬於org.elasticsearch.index.analysis包,在下文中一共展示了AnalysisModule類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = Settings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .put("path.home", System.getProperty("path.home"))
            .loadFromStream("icu_folding.json", getClass().getResourceAsStream("/org/xbib/elasticsearch/index/analysis/icu/icu_folding.json")).build();
    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)))
            .createInjector();
    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new IcuPlugin(settings).onModule(analysisModule);
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-icu,代碼行數:20,代碼來源:IcuCharFilterTests.java

示例2: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = Settings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .put("path.home", System.getProperty("path.home"))
            .loadFromStream("icu_tokenizer.json", getClass().getResourceAsStream("/org/xbib/elasticsearch/index/analysis/icu/icu_tokenizer.json")).build();
    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)))
            .createInjector();
    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new IcuPlugin(settings).onModule(analysisModule);
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-icu,代碼行數:20,代碼來源:IcuTokenizerTests.java

示例3: getAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService getAnalysisService() {
    Index index = new Index("test");

    Settings settings = ImmutableSettings.settingsBuilder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT).build();
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class))
                    .addProcessor(new RosetteAnalysisBinderProcessor()))
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);

}
 
開發者ID:basis-technology-corp,項目名稱:elasticsearch-analysis-rosette,代碼行數:17,代碼來源:SimpleRosetteAnalysisTests.java

示例4: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .loadFromClasspath("org/xbib/elasticsearch/index/analysis/decompound/decompound_analysis.json").build();

    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:24,代碼來源:DecompoundTokenFilterTests.java

示例5: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .loadFromClasspath("org/xbib/elasticsearch/index/analysis/german/test-settings.json").build();

    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:24,代碼來源:SettingsTests.java

示例6: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .loadFromClasspath("org/xbib/elasticsearch/index/analysis/german/german_normalization_analysis.json").build();

    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:24,代碼來源:GermanNormalizationTests.java

示例7: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .loadFromClasspath("org/xbib/elasticsearch/index/analysis/icu/icu_tokenizer.json").build();
    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:23,代碼來源:IcuTokenizerTests.java

示例8: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, org.elasticsearch.Version.CURRENT)
            .build();

    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:24,代碼來源:BaseformTokenFilterTests.java

示例9: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .loadFromClasspath("org/xbib/elasticsearch/index/analysis/hyphen/hyphen_tokenizer.json").build();
    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)),
            new IndicesAnalysisModule())
            .createInjector();
    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new AnalysisGermanPlugin().onModule(analysisModule);
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);
    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:19,代碼來源:HyphenTokenizerTests.java

示例10: testDefaultComboAnalysis

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
@Test
public void testDefaultComboAnalysis() {
    Settings settings = ImmutableSettings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .build();

    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(EMPTY_SETTINGS),
            new EnvironmentModule(new Environment(EMPTY_SETTINGS)),
            new IndicesAnalysisModule()).createInjector();
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            new AnalysisModule(EMPTY_SETTINGS, parentInjector.getInstance(IndicesAnalysisService.class))
                    .addProcessor(new ComboAnalysisBinderProcessor()))
            .createChildInjector(parentInjector);

    AnalysisService analysisService = injector.getInstance(AnalysisService.class);

    Analyzer analyzer = analysisService.analyzer("combo").analyzer();
    assertThat(analyzer, instanceOf(ComboAnalyzerWrapper.class));

}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-german,代碼行數:24,代碼來源:SimpleComboAnalysisTests.java

示例11: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    Settings settings = Settings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .put("path.home", System.getProperty("path.home"))
            .build();

    Index index = new Index("test");

    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
            new EnvironmentModule(new Environment(settings)))
            .createInjector();

    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new StandardnumberPlugin(settings).onModule(analysisModule);

    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-standardnumber,代碼行數:24,代碼來源:StandardNumberAnalysisTests.java

示例12: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private AnalysisService createAnalysisService() {
    InputStream in = getClass().getResourceAsStream("/org/xbib/elasticsearch/index/analysis/standardnumber.json");
    Settings settings = Settings.settingsBuilder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .put("path.home", System.getProperty("path.home"))
            .loadFromStream("settings", in)
            .build();
    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder()
            .add(new SettingsModule(settings),
                    new EnvironmentModule(new Environment(settings)))
            .createInjector();
    AnalysisModule analysisModule = new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class));
    new StandardnumberPlugin(settings).onModule(analysisModule);
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);
    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-standardnumber,代碼行數:22,代碼來源:StandardNumberTokenFilterTests.java

示例13: newAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
private static AnalysisService newAnalysisService(Settings indexSettings) {
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(indexSettings), new EnvironmentModule(new Environment(indexSettings))).createInjector();
    Index index = new Index("test");
    Injector injector = new ModulesBuilder().add(
        new IndexSettingsModule(index, indexSettings),
        new IndexNameModule(index),
        new AnalysisModule(indexSettings, parentInjector.getInstance(IndicesAnalysisService.class))).createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:11,代碼來源:MapperTestUtils.java

示例14: newMapper

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
public static MapperService newMapper(Settings settings) {
    Settings indexSettings = Settings.builder()
            .put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
            .put("path.home", System.getProperty("path.home"))
            .put("client.type", "node")
            .put(settings)
            .build();
    Index index = new Index("test");
    Injector parentInjector = new ModulesBuilder()
            .add(new SettingsModule(indexSettings),
                    new EnvironmentModule(new Environment(indexSettings)))
            .createInjector();
    AnalysisModule analysisModule = new AnalysisModule(indexSettings,
            parentInjector.getInstance(IndicesAnalysisService.class));
    new EudexPlugin(settings).onModule(analysisModule);
    Injector injector = new ModulesBuilder().add(new IndexSettingsModule(index, indexSettings),
            new IndexNameModule(index),
            analysisModule)
            .createChildInjector(parentInjector);
    AnalysisService analysisService = injector.getInstance(AnalysisService.class);
    SimilarityLookupService similarityLookupService = new SimilarityLookupService(index, indexSettings);
    Map<String, Mapper.TypeParser> mappers = registerBuiltInMappers();
    Map<String, MetadataFieldMapper.TypeParser> metadataMappers = registerBuiltInMetadataMappers();
    MapperRegistry mapperRegistry = new MapperRegistry(mappers, metadataMappers);
    return new MapperService(new Index("test"),
            indexSettings,
            analysisService,
            similarityLookupService,
            null,
            mapperRegistry);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-phonetic-eudex,代碼行數:32,代碼來源:MapperTestUtils.java

示例15: newAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //導入依賴的package包/類
public static AnalysisService newAnalysisService(Settings indexSettings) {
    Injector parentInjector = new ModulesBuilder().add(new SettingsModule(indexSettings),
            new EnvironmentModule(new Environment(indexSettings))).createInjector();
    Index index = new Index("test");
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, indexSettings),
            new IndexNameModule(index),
            new AnalysisModule(indexSettings, parentInjector.getInstance(IndicesAnalysisService.class))).createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
開發者ID:jprante,項目名稱:elasticsearch-analysis-opennlp,代碼行數:12,代碼來源:MapperTestUtils.java


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