本文整理汇总了Java中org.elasticsearch.indices.analysis.IndicesAnalysisService类的典型用法代码示例。如果您正苦于以下问题:Java IndicesAnalysisService类的具体用法?Java IndicesAnalysisService怎么用?Java IndicesAnalysisService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndicesAnalysisService类属于org.elasticsearch.indices.analysis包,在下文中一共展示了IndicesAnalysisService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例2: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例3: testDefaultsIcuAnalysis
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的package包/类
@Test
public void testDefaultsIcuAnalysis() {
Index index = new Index("test");
Settings settings = settingsBuilder()
.put("path.home", createTempDir())
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
.build();
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(EMPTY_SETTINGS), new EnvironmentModule(new Environment(settings))).createInjector();
Injector injector = new ModulesBuilder().add(
new IndexSettingsModule(index, settings),
new IndexNameModule(index),
new AnalysisModule(EMPTY_SETTINGS, parentInjector.getInstance(IndicesAnalysisService.class)).addProcessor(new HanLpAnalysisBinderProcessor()))
.createChildInjector(parentInjector);
AnalysisService analysisService = injector.getInstance(AnalysisService.class);
TokenizerFactory tokenizerFactory = analysisService.tokenizer("smartcn_tokenizer");
MatcherAssert.assertThat(tokenizerFactory, instanceOf(HanLpTokenizerTokenizerFactory.class));
}
示例4: provideWith
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的package包/类
public AnalysisService provideWith(Index index, Settings settings) {
Settings indexSettings = settingsBuilder().put(settings)
.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT)
.build();
Injector parentInjector = new ModulesBuilder().add(
new SettingsModule(settings),
new EnvironmentModule(new Environment(settings))).createInjector();
Injector injector = new ModulesBuilder().add(
new IndexSettingsModule(index, indexSettings),
new IndexNameModule(index),
new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class))
.addProcessor(new UkrainianLemmatizerBinderProcessor()))
.createChildInjector(parentInjector);
return injector.getInstance(AnalysisService.class);
}
开发者ID:mrgambal,项目名称:elasticsearch-ukrainian-lemmatizer,代码行数:17,代码来源:TestAnalysisServiceProvider.java
示例5: SherlokIndicesAnalysis
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的package包/类
@Inject
public SherlokIndicesAnalysis(final Settings settings,
final IndicesAnalysisService indicesAnalysisService) {
super(settings);
indicesAnalysisService.tokenFilterFactories().put("sherlok",
new SherlokTokenFilterFactoryFactory(new TokenFilterFactory() {
@Override
public String name() {
return "sherlok";
}
@Override
public TokenStream create(final TokenStream tokenStream) {
return new MinHashTokenFilter(tokenStream, MinHash
.createHashFunctions(0, 128), 1); //FIXME
}
}));
}
示例6: getAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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
示例7: AnnotationIndicesAnalysis
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的package包/类
@Inject
public AnnotationIndicesAnalysis(Settings settings,
IndicesAnalysisService indicesAnalysisService) {
super(settings);
indicesAnalysisService.analyzerProviderFactories().put(
"default",
new PreBuiltAnalyzerProviderFactory("default",
AnalyzerScope.INDICES, new AnnotationAnalyzer(
Lucene.ANALYZER_VERSION)));
indicesAnalysisService.tokenFilterFactories().put("annotation_filter",
new PreBuiltTokenFilterFactoryFactory(new TokenFilterFactory() {
@Override
public String name() {
return "annotation_filter";
}
@Override
public TokenStream create(TokenStream tokenStream) {
return new InlineAnnotationFilter(tokenStream);
}
}));
}
开发者ID:samekmichal,项目名称:elasticsearch-analysis-annotation,代码行数:24,代码来源:AnnotationIndicesAnalysis.java
示例8: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例9: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例10: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例11: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例12: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例13: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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);
}
示例14: testDefaultComboAnalysis
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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));
}
示例15: createAnalysisService
import org.elasticsearch.indices.analysis.IndicesAnalysisService; //导入依赖的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