diff --git a/pom.xml b/pom.xml
index ef725516b..329a83ee7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,7 @@
3.5.0-SNAPSHOT
- 8.17.4
+ 8.18.0
0.19.0
2.23.1
@@ -131,6 +131,12 @@
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ ${elasticsearch-java}
+
+
diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc
index d8b9fc7e6..46b4b522c 100644
--- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc
+++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc
@@ -4,7 +4,7 @@
[[new-features.5-5-0]]
== New in Spring Data Elasticsearch 5.5
-* Upgrade to Elasticsearch 8.17.4.
+* Upgrade to Elasticsearch 8.18.0.
* Add support for the `@SearchTemplateQuery` annotation on repository methods.
* Scripted field properties of type collection can be populated from scripts returning arrays.
diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc
index 8620ffc8b..bde67f92b 100644
--- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc
+++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc
@@ -6,7 +6,7 @@ The following table shows the Elasticsearch and Spring versions that are used by
[cols="^,^,^,^",options="header"]
|===
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework
-| 2025.0 (in development) | 5.5.x | 8.17.4 | 6.2.x
+| 2025.0 (in development) | 5.5.x | 8.18.0 | 6.2.x
| 2024.1 | 5.4.x | 8.15.5 | 6.1.x
| 2024.0 | 5.3.x | 8.13.4 | 6.1.x
| 2023.1 (Vaughan) | 5.2.xfootnote:oom[Out of maintenance] | 8.11.1 | 6.1.x
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
index aebd1cb1e..ef0700b8b 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/RequestConverter.java
@@ -55,6 +55,7 @@
import co.elastic.clients.json.JsonData;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
+import co.elastic.clients.util.NamedValue;
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonParser;
@@ -72,6 +73,7 @@
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -1365,9 +1367,14 @@ public MsearchRequest searchMsearchRequest(
}
if (!isEmpty(query.getIndicesBoost())) {
- bb.indicesBoost(query.getIndicesBoost().stream()
- .map(indexBoost -> Map.of(indexBoost.getIndexName(), (double) indexBoost.getBoost()))
- .collect(Collectors.toList()));
+ Stream> namedValueStream = query.getIndicesBoost().stream()
+ .map(indexBoost -> {
+ var namedValue = new NamedValue(indexBoost.getIndexName(),
+ Float.valueOf(indexBoost.getBoost()).doubleValue());
+ return namedValue;
+ });
+ List> namedValueList = namedValueStream.collect(Collectors.toList());
+ bb.indicesBoost(namedValueList);
}
query.getScriptedFields().forEach(scriptedField -> bb.scriptFields(scriptedField.getFieldName(),
@@ -1576,9 +1583,14 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu
}
if (!isEmpty(query.getIndicesBoost())) {
- builder.indicesBoost(query.getIndicesBoost().stream()
- .map(indexBoost -> Map.of(indexBoost.getIndexName(), (double) indexBoost.getBoost()))
- .collect(Collectors.toList()));
+ Stream> namedValueStream = query.getIndicesBoost().stream()
+ .map(indexBoost -> {
+ var namedValue = new NamedValue(indexBoost.getIndexName(),
+ Float.valueOf(indexBoost.getBoost()).doubleValue());
+ return namedValue;
+ });
+ List> namedValueList = namedValueStream.collect(Collectors.toList());
+ builder.indicesBoost(namedValueList);
}
if (!isEmpty(query.getDocValueFields())) {
diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
index 480c557c1..ce7211970 100644
--- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
+++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java
@@ -92,7 +92,7 @@ public ClusterHealth clusterHealth(HealthResponse healthResponse) {
return ClusterHealth.builder() //
.withActivePrimaryShards(healthResponse.activePrimaryShards()) //
.withActiveShards(healthResponse.activeShards()) //
- .withActiveShardsPercent(Double.parseDouble(healthResponse.activeShardsPercentAsNumber()))//
+ .withActiveShardsPercent(healthResponse.activeShardsPercentAsNumber())//
.withClusterName(healthResponse.clusterName()) //
.withDelayedUnassignedShards(healthResponse.delayedUnassignedShards()) //
.withInitializingShards(healthResponse.initializingShards()) //
diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties
index 7174db81c..d4a87a436 100644
--- a/src/test/resources/testcontainers-elasticsearch.properties
+++ b/src/test/resources/testcontainers-elasticsearch.properties
@@ -15,7 +15,7 @@
#
#
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
-sde.testcontainers.image-version=8.17.4
+sde.testcontainers.image-version=8.18.0
#
#
# needed as we do a DELETE /* at the end of the tests, will be required from 8.0 on, produces a warning since 7.13