use of org.elasticsearch.indices.mapper.MapperRegistry in project elasticsearch by elastic.
the class IndicesModuleTests method testBuiltinWithPlugins.
public void testBuiltinWithPlugins() {
IndicesModule module = new IndicesModule(fakePlugins);
MapperRegistry registry = module.getMapperRegistry();
assertThat(registry.getMapperParsers().size(), Matchers.greaterThan(1));
assertThat(registry.getMetadataMapperParsers().size(), Matchers.greaterThan(1));
}
use of org.elasticsearch.indices.mapper.MapperRegistry in project elasticsearch by elastic.
the class MapperTestUtils method newMapperService.
public static MapperService newMapperService(NamedXContentRegistry xContentRegistry, Path tempDir, Settings settings, IndicesModule indicesModule) throws IOException {
Settings.Builder settingsBuilder = Settings.builder().put(Environment.PATH_HOME_SETTING.getKey(), tempDir).put(settings);
if (settings.get(IndexMetaData.SETTING_VERSION_CREATED) == null) {
settingsBuilder.put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT);
}
Settings finalSettings = settingsBuilder.build();
MapperRegistry mapperRegistry = indicesModule.getMapperRegistry();
IndexSettings indexSettings = IndexSettingsModule.newIndexSettings("test", finalSettings);
IndexAnalyzers indexAnalyzers = createTestAnalysis(indexSettings, finalSettings).indexAnalyzers;
SimilarityService similarityService = new SimilarityService(indexSettings, Collections.emptyMap());
return new MapperService(indexSettings, indexAnalyzers, xContentRegistry, similarityService, mapperRegistry, () -> null);
}
Aggregations