@Configuration @EnableElasticsearchRepositories(queryLookupStrategy=CREATE_IF_NOT_FOUND) public class EsConfig extends Object
Constructor and Description |
---|
EsConfig() |
Modifier and Type | Method and Description |
---|---|
org.elasticsearch.client.transport.TransportClient |
client()
Bean that creates a configuration for elastic search using the properties acquired from the
application.properties file
|
org.springframework.data.elasticsearch.core.ElasticsearchOperations |
elasticsearchTemplate()
Creates an Elastic search template by creating and using an Elastic search client
|
@Bean public org.elasticsearch.client.transport.TransportClient client() throws UnknownHostException
UnknownHostException
- if the host cannot be found@Bean public org.springframework.data.elasticsearch.core.ElasticsearchOperations elasticsearchTemplate() throws UnknownHostException
ElasticsearchOperations
objectUnknownHostException
- if the host cannot be foundclient()
Copyright © 2019. All rights reserved.