use of com.enonic.xp.repository.IndexDefinitions in project xp by enonic.
the class RepositoryNodeTranslator method toIndexConfigs.
private static IndexDefinitions toIndexConfigs(final PropertyTree nodeData) {
final PropertySet indexConfigsSet = nodeData.getSet(INDEX_CONFIG_KEY);
if (indexConfigsSet != null) {
final IndexDefinitions.Builder indexConfigs = IndexDefinitions.create();
for (IndexType indexType : IndexType.values()) {
final PropertySet indexConfigSet = indexConfigsSet.getSet(indexType.getName());
if (indexConfigSet != null) {
final IndexDefinition.Builder indexConfig = IndexDefinition.create();
final PropertySet mappingSet = indexConfigSet.getSet(MAPPING_KEY);
indexConfig.mapping(mappingSet == null ? null : IndexMapping.from(mappingSet.toTree()));
final PropertySet settingsSet = indexConfigSet.getSet(SETTINGS_KEY);
indexConfig.settings(settingsSet == null ? null : IndexSettings.from(settingsSet.toTree()));
indexConfigs.add(indexType, indexConfig.build());
}
}
return indexConfigs.build();
}
return null;
}
Aggregations