Skip to content

Commit dd3389a

Browse files
committed
Use elasticsearch-rest5-client in spring-boot-elasticsearch
Signed-off-by: Filip Hrisafov <[email protected]>
1 parent 2f5e9b5 commit dd3389a

File tree

3 files changed

+9
-4
lines changed
  • documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/data
  • module/spring-boot-elasticsearch
  • platform/spring-boot-dependencies

3 files changed

+9
-4
lines changed

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/data/nosql.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ Spring Boot provides a dedicated starter, `spring-boot-starter-data-elasticsearc
314314
=== Connecting to Elasticsearch Using REST clients
315315

316316
Elasticsearch ships two different REST clients that you can use to query a cluster: the https://www.elastic.co/docs/reference/elasticsearch/clients/java/transport/rest5-client/[low-level client] and the https://www.elastic.co/docs/reference/elasticsearch/clients/java[Java API client].
317-
Both clients are provided by the `co.elastic.clients:elasticsearch-java` module.
317+
The Java API client is provided by the `co.elastic.clients:elasticsearch-java` module and
318+
the low-level client is provided by the `co.elastic.clients:elasticsearch-rest5-client` module.
318319
Additionally, Spring Boot provides support for a reactive client from the `org.springframework.data:spring-data-elasticsearch` module.
319320
By default, the clients will target `http://localhost:9200`.
320321
You can use `spring.elasticsearch.*` properties to further tune how the clients are configured, as shown in the following example:
@@ -334,7 +335,7 @@ spring:
334335
[[data.nosql.elasticsearch.connecting-using-rest.restclient]]
335336
==== Connecting to Elasticsearch Using Rest5Client
336337

337-
If you have `co.elastic.clients:elasticsearch-java` on the classpath, Spring Boot will auto-configure and register a javadoc:co.elastic.clients.transport.rest5_client.low_level.Rest5Client[] bean.
338+
If you have `co.elastic.clients:elasticsearch-rest5-client` on the classpath, Spring Boot will auto-configure and register a javadoc:co.elastic.clients.transport.rest5_client.low_level.Rest5Client[] bean.
338339
In addition to the properties described previously, to fine-tune the javadoc:co.elastic.clients.transport.rest5_client.low_level.Rest5Client[] you can register an arbitrary number of beans that implement javadoc:org.springframework.boot.elasticsearch.autoconfigure.Rest5ClientBuilderCustomizer[] for more advanced customizations.
339340
To take full control over the client's configuration, define a javadoc:co.elastic.clients.transport.rest5_client.low_level.Rest5ClientBuilder[] bean.
340341

module/spring-boot-elasticsearch/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ description = "Spring Boot Elasticsearch"
2727

2828
dependencies {
2929
api(project(":core:spring-boot"))
30-
api("co.elastic.clients:elasticsearch-java")
30+
api("co.elastic.clients:elasticsearch-rest5-client")
3131

3232
optional(project(":core:spring-boot-autoconfigure"))
3333
optional(project(":core:spring-boot-docker-compose"))
3434
optional(project(":core:spring-boot-testcontainers"))
3535
optional(project(":module:spring-boot-health"))
3636
optional(project(":module:spring-boot-jsonb"))
3737
optional(project(":module:spring-boot-reactor"))
38+
optional("co.elastic.clients:elasticsearch-java") {
39+
exclude group: "commons-logging", module: "commons-logging"
40+
}
3841

3942
optional("com.fasterxml.jackson.core:jackson-databind")
4043
optional("jakarta.json.bind:jakarta.json.bind-api")

platform/spring-boot-dependencies/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ bom {
367367
}
368368
group("co.elastic.clients") {
369369
modules = [
370-
"elasticsearch-java"
370+
"elasticsearch-java",
371+
"elasticsearch-rest5-client"
371372
]
372373
}
373374
links {

0 commit comments

Comments
 (0)