Elasticsearch is a provider of Spring Boot for handling search and CRUD operations in Elastic Search. Elasticsearch is a Full Text search engine and also provide REST based Elasticsearch APIs for operations. To use Elastic Search in your Spring boot application you have to add this Elasticsearch starter in your pom.xml .
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
After adding Elasticsearch starter in your application it will automatically download and add the required dependencies in your application and initialize with default values. You can overwrite these values through application.properties / application.yaml .
ElasticSearch Configuration Properties
Spring Boot load these properties in ElasticsearchProperties class.
Name | Default Value | Description |
spring.data.elasticsearch.cluster-name | elasticsearch | cluster name. |
spring.data.elasticsearch.cluster-nodes | Comma-separated cluster node addresses. If not specified, starts a client node. | |
spring.data.elasticsearch.properties.* | Additional properties used to configure the client. | |
spring.data.elasticsearch.repositories.enabled | true | Enable Elasticsearch repositories. |
JEST (Elasticsearch HTTP client) Configuration Properties
Spring Boot load these properties in JestProperties class.
Name | Default Value | Description |
spring.elasticsearch.jest.connection-timeout | 3000 | Connection timeout in milliseconds. |
spring.elasticsearch.jest.password | Login password. | |
spring.elasticsearch.jest.proxy.host | Proxy host the HTTP client to use. | |
spring.elasticsearch.jest.proxy.port | Proxy port the HTTP client to use. | |
spring.elasticsearch.jest.read-timeout | 3000 | Read timeout. (in milliseconds) |
spring.elasticsearch.jest.uris | http://localhost:9200 | Comma-separated Elasticsearch instances to use. |
spring.elasticsearch.jest.username | Login user. |
References
https://docs.spring.io/spring-boot/docs/1.4.x/reference/html/common-application-properties.html
Happy Learning !!!