org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter Java Examples

The following examples show how to use org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeihuMutilElasticsearchAutoConfiguration.java    From beihu-boot with Apache License 2.0 5 votes vote down vote up
public ElasticsearchTemplate elasticsearchTemplate(Client client) {
    try {
        SimpleElasticsearchMappingContext simpleElasticsearchMappingContext = new SimpleElasticsearchMappingContext();
        ElasticsearchConverter elasticsearchConverter = new MappingElasticsearchConverter(simpleElasticsearchMappingContext);
        return new ElasticsearchTemplate(client, elasticsearchConverter);
    } catch (Exception var4) {
        throw new IllegalStateException(var4);
    }
}
 
Example #2
Source File: ElasticsearchConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 5 votes vote down vote up
@Bean
@Primary
public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient,
                                                     final ElasticsearchConverter elasticsearchConverter,
                                                     final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext,
                                                     EntityMapper mapper) {
    return new JestElasticsearchTemplate(
        jestClient,
        elasticsearchConverter,
        new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper));
}
 
Example #3
Source File: ElasticsearchConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 5 votes vote down vote up
@Bean
@Primary
public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient,
                                                     final ElasticsearchConverter elasticsearchConverter,
                                                     final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext,
                                                     EntityMapper mapper) {
    return new JestElasticsearchTemplate(
        jestClient,
        elasticsearchConverter,
        new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper));
}
 
Example #4
Source File: ElasticsearchConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 5 votes vote down vote up
@Bean
@Primary
public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient,
                                                     final ElasticsearchConverter elasticsearchConverter,
                                                     final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext,
                                                     EntityMapper mapper) {
    return new JestElasticsearchTemplate(
        jestClient,
        elasticsearchConverter,
        new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper));
}
 
Example #5
Source File: ElasticsearchConfiguration.java    From 21-points with Apache License 2.0 5 votes vote down vote up
@Bean
@Primary
public ElasticsearchOperations elasticsearchTemplate(final JestClient jestClient,
                                                     final ElasticsearchConverter elasticsearchConverter,
                                                     final SimpleElasticsearchMappingContext simpleElasticsearchMappingContext,
                                                     EntityMapper mapper) {
    return new JestElasticsearchTemplate(
        jestClient,
        elasticsearchConverter,
        new DefaultJestResultsMapper(simpleElasticsearchMappingContext, mapper));
}