use of org.elasticsearch.env.EnvironmentModule in project elasticsearch-skywalker by jprante.
the class SkywalkerTests method test.
@Test
public void test() {
Settings settings = ImmutableSettings.settingsBuilder().build();
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings), new EnvironmentModule(new Environment(settings)), new IndicesAnalysisModule()).createInjector();
ActionModule actionModule = new ActionModule(true);
RestModule restModule = new RestModule(settings);
SkywalkerPlugin plugin = new SkywalkerPlugin();
plugin.onModule(actionModule);
plugin.onModule(restModule);
}
use of org.elasticsearch.env.EnvironmentModule in project crate by crate.
the class LuceneQueryBuilderTest method createAnalysisService.
private AnalysisService createAnalysisService(Settings indexSettings, Index index) {
Injector parentInjector = new ModulesBuilder().add(new SettingsModule(indexSettings), new EnvironmentModule(new Environment(indexSettings))).createInjector();
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);
}
Aggregations