Upgrade to Elasticsearch 7.17.8.

Original Pull Request #2413
Closes #2401
This commit is contained in:
Peter-Josef Meisch 2022-12-31 00:30:58 +01:00 committed by GitHub
parent bb05d0ba76
commit 87be6dbd82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 37 additions and 11 deletions

View File

@ -19,9 +19,9 @@
<properties>
<!-- version of the RestHighLevelClient -->
<elasticsearch-rhlc>7.17.7</elasticsearch-rhlc>
<elasticsearch-rhlc>7.17.8</elasticsearch-rhlc>
<!-- version of the new ElasticsearchClient -->
<elasticsearch-java>7.17.7</elasticsearch-java>
<elasticsearch-java>7.17.8</elasticsearch-java>
<log4j>2.17.1</log4j>
<netty>4.1.65.Final</netty>
<springdata.commons>2.7.7-SNAPSHOT</springdata.commons>

View File

@ -37,7 +37,7 @@ built and tested.
[cols="^,^,^,^,^",options="header"]
|===
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework | Spring Boot
| 2021.2 (Raj) | 4.4.x | 7.17.7 | 5.3.x | 2.7.x
| 2021.2 (Raj) | 4.4.x | 7.17.8 | 5.3.x | 2.7.x
| 2021.1 (Q) | 4.3.x | 7.15.2 | 5.3.x | 2.6.x
| 2021.0 (Pascal) | 4.2.xfootnote:oom[Out of maintenance] | 7.12.0 | 5.3.x | 2.5.x
| 2020.0 (Ockham)footnote:oom[] | 4.1.xfootnote:oom[] | 7.9.3 | 5.3.2 | 2.4.x

View File

@ -82,7 +82,7 @@ The dependencies for the new Elasticsearch client are still optional in Spring D
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>7.17.7</version>
<version>7.17.8</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@ -93,7 +93,7 @@ The dependencies for the new Elasticsearch client are still optional in Spring D
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId> <!-- is Apache 2-->
<version>7.17.7</version>
<version>7.17.8</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>

View File

@ -138,9 +138,8 @@ final class DocumentAdapters {
document.setPrimaryTerm(hit.primaryTerm() != null && hit.primaryTerm() > 0 ? hit.primaryTerm() : 0);
float score = hit.score() != null ? hit.score().floatValue() : Float.NaN;
return new SearchDocumentAdapter(document, score, hit.sort().toArray(new String[0]), documentFields,
highlightFields, innerHits, nestedMetaData, explanation, matchedQueries, hit.routing());
}
return new SearchDocumentAdapter(document, score, hit.sort().stream().map(TypeUtils::toString).toArray(),
documentFields, highlightFields, innerHits, nestedMetaData, explanation, matchedQueries, hit.routing()); }
@Nullable
private static Explanation from(@Nullable co.elastic.clients.elasticsearch.core.explain.Explanation explanation) {

View File

@ -19,6 +19,7 @@ import static org.springframework.data.elasticsearch.client.elc.TypeUtils.*;
import static org.springframework.util.CollectionUtils.*;
import co.elastic.clients.elasticsearch._types.Conflicts;
import co.elastic.clients.elasticsearch._types.FieldValue;
import co.elastic.clients.elasticsearch._types.InlineScript;
import co.elastic.clients.elasticsearch._types.OpType;
import co.elastic.clients.elasticsearch._types.SortOptions;
@ -754,7 +755,7 @@ class RequestConverter {
ReindexRequest.Slice slice = source.getSlice();
if (slice != null) {
s.slice(sl -> sl.id(slice.getId()).max(slice.getMax()));
s.slice(sl -> sl.id(String.valueOf(slice.getId())).max(slice.getMax()));
}
if (source.getQuery() != null) {
@ -1168,7 +1169,8 @@ class RequestConverter {
}
if (!isEmpty(query.getSearchAfter())) {
builder.searchAfter(query.getSearchAfter().stream().map(Object::toString).collect(Collectors.toList()));
builder.searchAfter(
query.getSearchAfter().stream().map(it -> FieldValue.of(it.toString())).collect(Collectors.toList()));
}
query.getRescorerQueries().forEach(rescorerQuery -> {

View File

@ -122,6 +122,31 @@ final class TypeUtils {
return null;
}
@Nullable
static String toString(@Nullable FieldValue fieldValue) {
if (fieldValue == null) {
return null;
}
switch (fieldValue._kind()) {
case Double:
return String.valueOf(fieldValue.doubleValue());
case Long:
return String.valueOf(fieldValue.longValue());
case Boolean:
return String.valueOf(fieldValue.booleanValue());
case String:
return fieldValue.stringValue();
case Null:
return null;
case Any:
return fieldValue.anyValue().toString();
default:
throw new IllegalStateException("Unexpected value: " + fieldValue._kind());
}
}
@Nullable
static GeoDistanceType geoDistanceType(GeoDistanceOrder.DistanceType distanceType) {

View File

@ -15,7 +15,7 @@
#
#
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
sde.testcontainers.image-version=7.17.7
sde.testcontainers.image-version=7.17.8
#
#
# 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