Search in sources :

Example 6 with IndexMapping

use of com.enonic.xp.repository.IndexMapping in project xp by enonic.

the class NodeRepositoryServiceImpl method mergeMappings.

private static IndexMapping mergeMappings(IndexMapping... indexMappings) {
    JsonNode intermediate = JsonHelper.from(Map.of());
    Arrays.stream(indexMappings).filter(Objects::nonNull).forEach(indexMapping -> JsonHelper.merge(intermediate, indexMapping.getNode()));
    return new IndexMapping(intermediate);
}
Also used : IndexMapping(com.enonic.xp.repository.IndexMapping) JsonNode(com.fasterxml.jackson.databind.JsonNode)

Aggregations

IndexMapping (com.enonic.xp.repository.IndexMapping)6 IndexSettings (com.enonic.xp.repository.IndexSettings)4 IndexType (com.enonic.xp.index.IndexType)3 IndexDefinition (com.enonic.xp.repository.IndexDefinition)2 Map (java.util.Map)2 PropertySet (com.enonic.xp.data.PropertySet)1 UpdateIndexSettings (com.enonic.xp.repo.impl.index.UpdateIndexSettings)1 IndexDefinitions (com.enonic.xp.repository.IndexDefinitions)1 IndexException (com.enonic.xp.repository.IndexException)1 Repository (com.enonic.xp.repository.Repository)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ElasticsearchException (org.elasticsearch.ElasticsearchException)1 CreateIndexRequest (org.elasticsearch.action.admin.indices.create.CreateIndexRequest)1 CreateIndexResponse (org.elasticsearch.action.admin.indices.create.CreateIndexResponse)1 ImmutableOpenMap (org.elasticsearch.common.collect.ImmutableOpenMap)1