Search in sources :

Example 1 with ElasticsearchCustomConversions

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

the class ElasticsearchStringQueryUnitTestBase method setupConverter.

protected ElasticsearchConverter setupConverter() {
    MappingElasticsearchConverter converter = new MappingElasticsearchConverter(new SimpleElasticsearchMappingContext());
    Collection<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(ElasticsearchStringQueryUnitTests.CarConverter.INSTANCE);
    CustomConversions customConversions = new ElasticsearchCustomConversions(converters);
    converter.setConversions(customConversions);
    converter.afterPropertiesSet();
    return converter;
}
Also used : SimpleElasticsearchMappingContext(org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext) CustomConversions(org.springframework.data.convert.CustomConversions) ElasticsearchCustomConversions(org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions) ArrayList(java.util.ArrayList) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) Converter(org.springframework.core.convert.converter.Converter) ElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter) MappingElasticsearchConverter(org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter) ElasticsearchCustomConversions(org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions)

Aggregations

ArrayList (java.util.ArrayList)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 MappingElasticsearchConverter (org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter)1 SimpleElasticsearchMappingContext (org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext)1