• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnalysisModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.elasticsearch.index.analysis.AnalysisModule的典型用法代码示例。如果您正苦于以下问题:Java AnalysisModule类的具体用法?Java AnalysisModule怎么用?Java AnalysisModule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnalysisModule类属于org.elasticsearch.index.analysis包,在下文中一共展示了AnalysisModule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: newMapperService

import org.elasticsearch.index.analysis.AnalysisModule; //导入依赖的package包/类
public static MapperService newMapperService(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 OpenNLPAnalysisPlugin().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-opennlp,代码行数:32,代码来源:MapperTestUtils.java


示例17: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //导入依赖的package包/类
private AnalysisService createAnalysisService(Index index, Settings settings) {
    Injector parentInjector = new ModulesBuilder()
            .add(new SettingsModule(settings),
                    new EnvironmentModule(new Environment(settings)))
            .createInjector();
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class))
                    .addProcessor(new IcuAnalysisBinderProcessor()))
            .createChildInjector(parentInjector);

    return injector.getInstance(AnalysisService.class);
}
 
开发者ID:jprante,项目名称:elasticsearch-icu,代码行数:15,代码来源:IcuCollationAnalyzerTests.java


示例18: testDefaultsIcuAnalysis

import org.elasticsearch.index.analysis.AnalysisModule; //导入依赖的package包/类
@Test
public void testDefaultsIcuAnalysis() {
    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();
    Injector injector = new ModulesBuilder().add(
            new IndexSettingsModule(index, settings),
            new IndexNameModule(index),
            new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class))
                    .addProcessor(new IcuAnalysisBinderProcessor()))
            .createChildInjector(parentInjector);

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

    TokenizerFactory tokenizerFactory = analysisService.tokenizer("icu_tokenizer");
    assertThat(tokenizerFactory, instanceOf(IcuTokenizerFactory.class));

    TokenFilterFactory filterFactory = analysisService.tokenFilter("icu_normalizer");
    assertThat(filterFactory, instanceOf(IcuNormalizerTokenFilterFactory.class));

    filterFactory = analysisService.tokenFilter("icu_folding");
    assertThat(filterFactory, instanceOf(IcuFoldingTokenFilterFactory.class));

    filterFactory = analysisService.tokenFilter("icu_transform");
    assertThat(filterFactory, instanceOf(IcuTransformTokenFilterFactory.class));

    Analyzer analyzer = analysisService.analyzer("icu_collation");
    assertThat(analyzer, instanceOf(NamedAnalyzer.class));

}
 
开发者ID:jprante,项目名称:elasticsearch-icu,代码行数:39,代码来源:IcuAnalysisTests.java


示例19: newMapperService

import org.elasticsearch.index.analysis.AnalysisModule; //导入依赖的package包/类
public static MapperService newMapperService(Settings settings, Client client) {
    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 AnalysisBaseformPlugin(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-baseform,代码行数:32,代码来源:MapperTestUtils.java


示例20: createAnalysisService

import org.elasticsearch.index.analysis.AnalysisModule; //导入依赖的package包/类
private AnalysisService createAnalysisService(Settings settings) {
    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,代码行数:15,代码来源:WordDelimiterFilter2Tests.java



注:本文中的org.elasticsearch.index.analysis.AnalysisModule类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JavaVisibility类代码示例发布时间:2022-05-21
下一篇:
Java This类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap