1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

Expose primary ResultsMapper

This commit is contained in:
dengchao@xgtl 2020-04-17 17:07:55 +08:00
parent 58518caef0
commit e0b97ecbd5

View File

@ -0,0 +1,21 @@
package com.chatopera.cc.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.elasticsearch.core.DefaultResultMapper;
import org.springframework.data.elasticsearch.core.ResultsMapper;
import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity;
import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.lang.NonNull;
@Configuration
public class ElasticsearchConfig {
@Bean
@Primary
public ResultsMapper resultsMapper(@NonNull MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) {
return new DefaultResultMapper(mappingContext);
}
}