Search in sources :

Example 1 with MappingElasticsearchConverter

use of org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter in project spring-data-elasticsearch by spring-projects.

the class ElasticsearchConfigurationSupport method elasticsearchEntityMapper.

@Bean
public ElasticsearchConverter elasticsearchEntityMapper(SimpleElasticsearchMappingContext elasticsearchMappingContext, ElasticsearchCustomConversions elasticsearchCustomConversions) {
    MappingElasticsearchConverter elasticsearchConverter = new MappingElasticsearchConverter(elasticsearchMappingContext);
    elasticsearchConverter.setConversions(elasticsearchCustomConversions);
    return elasticsearchConverter;
}
Also used : MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) Bean(org.springframework.context.annotation.Bean)

Example 2 with MappingElasticsearchConverter

use of org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter in project spring-data-elasticsearch by spring-projects.

the class EntityOperationsTest method setUpAll.

@BeforeAll
static void setUpAll() {
    mappingContext = new SimpleElasticsearchMappingContext();
    mappingContext.setInitialEntitySet(new HashSet<>(Arrays.asList(EntityWithRouting.class)));
    mappingContext.afterPropertiesSet();
    entityOperations = new EntityOperations(mappingContext);
    MappingElasticsearchConverter converter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
    converter.afterPropertiesSet();
    conversionService = converter.getConversionService();
}
Also used : SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) GenericConversionService(org.springframework.core.convert.support.GenericConversionService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with MappingElasticsearchConverter

use of org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter in project spring-data-elasticsearch by spring-projects.

the class RequestFactoryTests method setUpAll.

@BeforeAll
static void setUpAll() {
    SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext();
    mappingContext.setInitialEntitySet(new HashSet<>(Arrays.asList(Person.class, EntityWithSeqNoPrimaryTerm.class)));
    mappingContext.afterPropertiesSet();
    converter = new MappingElasticsearchConverter(mappingContext, new GenericConversionService());
    converter.afterPropertiesSet();
    requestFactory = new RequestFactory((converter));
}
Also used : SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) GenericConversionService(org.springframework.core.convert.support.GenericConversionService) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 4 with MappingElasticsearchConverter

use of org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter in project spring-data-elasticsearch by spring-projects.

the class AbstractElasticsearchTemplate method createElasticsearchConverter.

private ElasticsearchConverter createElasticsearchConverter() {
    MappingElasticsearchConverter mappingElasticsearchConverter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
    mappingElasticsearchConverter.afterPropertiesSet();
    return mappingElasticsearchConverter;
}
Also used : SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter)

Example 5 with MappingElasticsearchConverter

use of org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter in project spring-data-elasticsearch by spring-projects.

the class ElasticsearchPartQueryTests method setUp.

@BeforeEach
public void setUp() {
    converter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
    when(operations.getElasticsearchConverter()).thenReturn(converter);
}
Also used : SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MappingElasticsearchConverter (org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter)7 SimpleElasticsearchMappingContext (org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext)6 GenericConversionService (org.springframework.core.convert.support.GenericConversionService)3 BeforeAll (org.junit.jupiter.api.BeforeAll)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 ArrayList (java.util.ArrayList)1 Bean (org.springframework.context.annotation.Bean)1 Converter (org.springframework.core.convert.converter.Converter)1 CustomConversions (org.springframework.data.convert.CustomConversions)1 ElasticsearchConverter (org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter)1 ElasticsearchCustomConversions (org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions)1