Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a295cfa12 | |||
| efe7932d42 | |||
| 26a7b48c4b | |||
| 34a0d9b600 | |||
| cb32d1991d | |||
| fbf9c355fa | |||
| 2dbca48cdf | |||
| e7366973b7 |
+1
-1
@@ -3,6 +3,6 @@
|
||||
<extension>
|
||||
<groupId>io.spring.develocity.conventions</groupId>
|
||||
<artifactId>develocity-conventions-maven-extension</artifactId>
|
||||
<version>0.0.22</version>
|
||||
<version>0.0.25</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Java versions
|
||||
java.main.tag=25-jdk-noble
|
||||
java.next.tag=25-jdk-noble
|
||||
java.main.tag=25.0.1_8-jdk-noble
|
||||
java.next.tag=25.0.1_8-jdk-noble
|
||||
|
||||
# Docker container images - standard
|
||||
docker.java.main.image=library/eclipse-temurin:${java.main.tag}
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-elasticsearch</artifactId>
|
||||
<version>6.0.2</version>
|
||||
<version>6.0.3</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>4.0.2</version>
|
||||
<version>4.0.3</version>
|
||||
</parent>
|
||||
|
||||
<name>Spring Data Elasticsearch</name>
|
||||
@@ -18,11 +18,11 @@
|
||||
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
|
||||
|
||||
<properties>
|
||||
<springdata.commons>4.0.2</springdata.commons>
|
||||
<springdata.commons>4.0.3</springdata.commons>
|
||||
|
||||
<!-- version of the ElasticsearchClient -->
|
||||
<elasticsearch-java>9.2.3</elasticsearch-java>
|
||||
<elasticsearch-rest-client>9.2.3</elasticsearch-rest-client>
|
||||
<elasticsearch-java>9.2.5</elasticsearch-java>
|
||||
<elasticsearch-rest-client>9.2.5</elasticsearch-rest-client>
|
||||
|
||||
<hoverfly>0.20.2</hoverfly>
|
||||
<log4j>2.25.1</log4j>
|
||||
|
||||
@@ -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.1 | 6.0.x | 9.2.3 | 7.0.x
|
||||
| 2025.1 | 6.0.x | 9.2.5 | 7.0.x
|
||||
| 2025.0 | 5.5.x | 8.18.1 | 6.2.x
|
||||
| 2024.1 | 5.4.xfootnote:oom[Out of maintenance] | 8.15.5 | 6.1.x
|
||||
| 2024.0 | 5.3.xfootnote:oom[] | 8.13.4 | 6.1.x
|
||||
|
||||
+14
-11
@@ -48,6 +48,7 @@ import co.elastic.clients.elasticsearch.core.search.Rescore;
|
||||
import co.elastic.clients.elasticsearch.core.search.SearchRequestBody;
|
||||
import co.elastic.clients.elasticsearch.core.search.SourceConfig;
|
||||
import co.elastic.clients.elasticsearch.indices.*;
|
||||
import co.elastic.clients.elasticsearch.indices.ExistsIndexTemplateRequest;
|
||||
import co.elastic.clients.elasticsearch.indices.ExistsRequest;
|
||||
import co.elastic.clients.elasticsearch.indices.update_aliases.Action;
|
||||
import co.elastic.clients.elasticsearch.sql.query.SqlFormat;
|
||||
@@ -77,15 +78,12 @@ import java.util.stream.Stream;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.core.RefreshPolicy;
|
||||
import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
|
||||
import org.springframework.data.elasticsearch.core.document.Document;
|
||||
import org.springframework.data.elasticsearch.core.index.AliasAction;
|
||||
import org.springframework.data.elasticsearch.core.index.AliasActionParameters;
|
||||
import org.springframework.data.elasticsearch.core.index.AliasActions;
|
||||
import org.springframework.data.elasticsearch.core.index.*;
|
||||
import org.springframework.data.elasticsearch.core.index.DeleteIndexTemplateRequest;
|
||||
import org.springframework.data.elasticsearch.core.index.DeleteTemplateRequest;
|
||||
import org.springframework.data.elasticsearch.core.index.ExistsTemplateRequest;
|
||||
@@ -1065,7 +1063,10 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
return UpdateRequest.of(uqb -> {
|
||||
uqb.index(indexName).id(query.getId());
|
||||
|
||||
if (query.getScript() != null) {
|
||||
var scriptData = query.getScriptData();
|
||||
var script = scriptData != null ? scriptData.script() : null;
|
||||
|
||||
if (script != null) {
|
||||
Map<String, JsonData> params = new HashMap<>();
|
||||
|
||||
if (query.getParams() != null) {
|
||||
@@ -1073,11 +1074,14 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
}
|
||||
|
||||
uqb.script(sb -> {
|
||||
sb.lang(query.getLang()).params(params);
|
||||
if (query.getScript() != null) {
|
||||
sb.source(s -> s.scriptString(query.getScript()));
|
||||
sb
|
||||
.lang(scriptData.language())
|
||||
.params(params);
|
||||
|
||||
if (script != null) {
|
||||
sb.source(s -> s.scriptString(script));
|
||||
}
|
||||
sb.id(query.getId());
|
||||
sb.id(scriptData.scriptName());
|
||||
|
||||
return sb;
|
||||
});
|
||||
@@ -1126,8 +1130,7 @@ class RequestConverter extends AbstractQueryProcessor {
|
||||
}
|
||||
|
||||
return uqb;
|
||||
} //
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public UpdateByQueryRequest documentUpdateByQueryRequest(UpdateQuery updateQuery, IndexCoordinates index,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data Elasticsearch 6.0.2 (2025.1.2)
|
||||
Spring Data Elasticsearch 6.0.3 (2025.1.3)
|
||||
Copyright (c) [2013-2022] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
@@ -18,3 +18,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+35
@@ -17,6 +17,7 @@ package org.springframework.data.elasticsearch.client.elc;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import co.elastic.clients.elasticsearch.core.UpdateRequest;
|
||||
import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,6 +37,7 @@ import org.springframework.data.elasticsearch.core.query.CriteriaQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.DeleteQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.DocValueField;
|
||||
import org.springframework.data.elasticsearch.core.query.StringQuery;
|
||||
import org.springframework.data.elasticsearch.core.query.UpdateQuery;
|
||||
|
||||
/**
|
||||
* @author Peter-Josef Meisch
|
||||
@@ -96,4 +98,37 @@ class RequestConverterTest {
|
||||
@Nullable
|
||||
@Field(type = FieldType.Text) private String text;
|
||||
}
|
||||
|
||||
@Test // #3231
|
||||
@DisplayName("should not use updatequery id for script id")
|
||||
void shouldNotUseUpdatequeryIdForScriptId() {
|
||||
var updateQuery = UpdateQuery
|
||||
.builder("queryId")
|
||||
.withScript("script")
|
||||
.build();
|
||||
|
||||
UpdateRequest<org.springframework.data.elasticsearch.core.document.Document, ?> updateRequest = requestConverter
|
||||
.documentUpdateRequest(updateQuery, IndexCoordinates.of("foo"), null, null);
|
||||
|
||||
assertThat(updateRequest.id()).isEqualTo("queryId");
|
||||
assertThat(updateRequest.script().source().scriptString()).isEqualTo("script");
|
||||
assertThat(updateRequest.script().id()).isNull();
|
||||
}
|
||||
|
||||
@Test // #3231
|
||||
@DisplayName("should use script name as update query id")
|
||||
void shouldUseScriptNameAsUpdateQueryId() {
|
||||
var updateQuery = UpdateQuery
|
||||
.builder("queryId")
|
||||
.withScript("script")
|
||||
.withScriptName("scriptName")
|
||||
.build();
|
||||
|
||||
UpdateRequest<org.springframework.data.elasticsearch.core.document.Document, ?> updateRequest = requestConverter
|
||||
.documentUpdateRequest(updateQuery, IndexCoordinates.of("foo"), null, null);
|
||||
|
||||
assertThat(updateRequest.id()).isEqualTo("queryId");
|
||||
assertThat(updateRequest.script().source().scriptString()).isEqualTo("script");
|
||||
assertThat(updateRequest.script().id()).isEqualTo("scriptName");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#
|
||||
#
|
||||
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
|
||||
sde.testcontainers.image-version=9.2.3
|
||||
sde.testcontainers.image-version=9.2.5
|
||||
#
|
||||
#
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user