1
0
mirror of synced 2026-05-23 04:33:17 +00:00

Compare commits

...

11 Commits

Author SHA1 Message Date
Mark Paluch 66144d10f8 Release version 6.0.1 (2025.1.1).
See #3197
2025-12-12 12:20:35 +01:00
Mark Paluch e6aefc8180 Prepare 6.0.1 (2025.1.1).
See #3197
2025-12-12 12:20:16 +01:00
Mark Paluch a7bd311106 Polishing.
Simplify test dependency setup, remove no longer required servlet/xbean dependencies, exclude commons-lang3 in favor of the Testcontainers variant. Remove outdated commons-codec dependency in favor of the Testcontainers variant.

See #3212
2025-12-11 09:02:48 +01:00
Mark Paluch 003d75f022 Add @ContextConfiguration(…) to test classes that use @SpringIntegrationTest on super classes.
Closes #3212
2025-12-11 09:02:48 +01:00
Mark Paluch 535b407085 Update CI Properties.
See #3197
2025-12-10 08:35:04 +01:00
Peter-Josef Meisch 44919d4cbe Upgrade Elasticsearch to 9.2.2.
Close #3208

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
2025-12-05 00:01:14 +01:00
Peter-Josef Meisch 6260f278ba Fix UpdateQuery.Builder to allow only a scriptname to be set.
Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
(cherry picked from commit 69746441e1)
2025-12-04 23:25:34 +01:00
Peter-Josef Meisch b3bd77aa46 Adjust aot hints for Elasticsearch 9 client.
The hints for the old httpclient are only needed when the old library is on the classpath, in case a user still uses the old RestClient. For the new Elasticsearch client there are no aot hints required.

Closes: #3203

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
(cherry picked from commit e31b66768b)
2025-11-25 20:11:04 +01:00
Peter-Josef Meisch bea651bc95 Fix documentation.
Closes #3199

Signed-off-by: Peter-Josef Meisch <pj.meisch@sothawo.com>
(cherry picked from commit 5821a81db9)
2025-11-14 19:02:47 +01:00
Mark Paluch 175614cd94 After release cleanups.
See #3186
2025-11-14 13:56:30 +01:00
Mark Paluch c4c73709c8 Prepare next development iteration.
See #3186
2025-11-14 13:56:29 +01:00
14 changed files with 106 additions and 59 deletions
Vendored
+1 -1
View File
@@ -9,7 +9,7 @@ pipeline {
triggers {
pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-commons/main", threshold: hudson.model.Result.SUCCESS)
upstream(upstreamProjects: "spring-data-commons/4.0.x", threshold: hudson.model.Result.SUCCESS)
}
options {
+3 -2
View File
@@ -14,11 +14,12 @@ docker.mongodb.8.0.version=8.0.9
# Supported versions of Redis
docker.redis.6.version=6.2.13
docker.redis.7.version=7.2.4
docker.redis.8.version=8.2.2
docker.valkey.8.version=8.1.1
# Docker environment settings
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home --ulimit nofile=32000:32000
# Credentials
docker.registry=
+26 -35
View File
@@ -5,12 +5,12 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>6.0.0</version>
<version>6.0.1</version>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>4.0.0</version>
<version>4.0.1</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.0</springdata.commons>
<springdata.commons>4.0.1</springdata.commons>
<!-- version of the ElasticsearchClient -->
<elasticsearch-java>9.2.1</elasticsearch-java>
<elasticsearch-rest-client>9.2.1</elasticsearch-rest-client>
<elasticsearch-java>9.2.2</elasticsearch-java>
<elasticsearch-rest-client>9.2.2</elasticsearch-rest-client>
<hoverfly>0.20.2</hoverfly>
<log4j>2.25.1</log4j>
@@ -91,6 +91,27 @@
<url>https://github.com/spring-projects/spring-data-elasticsearch/issues</url>
</issueManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.20.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring -->
@@ -301,21 +322,6 @@
<scope>test</scope>
</dependency>
<!-- Upgrade xbean to 4.5 to prevent incompatibilities due to ASM versions -->
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm5-shaded</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
@@ -323,27 +329,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-elasticsearch</artifactId>
<scope>test</scope>
</dependency>
<!--we need Murmur3Hash in a test, before 5.2 we had it from the old Elasticsearch dependency -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit5</artifactId>
@@ -461,7 +461,7 @@ To see what is actually sent to and received from the server `Request` / `Respon
This can be enabled in the Elasticsearch client by setting the level of the `co.elastic.clients.transport.rest5_client.low_level.Request` package to "trace" (see
https://www.elastic.co/docs/reference/elasticsearch/clients/java/transport/rest5-client/usage/logging)
.Enable transport layer logging
.Enable transport layer logging
[tabs]
======
XML::
@@ -485,4 +485,4 @@ ini::
----
logging.level.co.elastic.clients.transport.rest5_client.low_level.Request=trace
----
=====
======
@@ -6,7 +6,7 @@
* Upgrade to Spring 7
* Switch to jspecify nullability annotations
* Upgrade to Elasticsearch 9.2.1
* Upgrade to Elasticsearch 9.2.2
* Use the new Elasticsearch Rest5Client as default
* Add support for SpEL expressions in the `settingPath` parameter of the `@Setting` annotation
@@ -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.1 | 7.0.x
| 2025.1 | 6.0.x | 9.2.2 | 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
@@ -24,6 +24,7 @@ import org.jspecify.annotations.Nullable;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.aot.hint.TypeReference;
import org.springframework.util.ClassUtils;
/**
* runtime hints for the Elasticsearch client libraries, as these do not provide any of their own.
@@ -37,20 +38,20 @@ public class ElasticsearchClientRuntimeHints implements RuntimeHintsRegistrar {
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.reflection()
.registerType(TypeReference.of(IndexSettings.class), builder -> builder.withField("_DESERIALIZER")) //
.registerType(TypeReference.of(PutMappingRequest.class), builder -> builder.withField("_DESERIALIZER")) //
.registerType(TypeReference.of(RuntimeFieldType.class), builder -> builder.withField("_DESERIALIZER"))//
.registerType(TypeReference.of(TypeMapping.class), builder -> builder.withField("_DESERIALIZER")) //
;
.registerType(TypeReference.of(IndexSettings.class), builder -> builder.withField("_DESERIALIZER"))
.registerType(TypeReference.of(PutMappingRequest.class), builder -> builder.withField("_DESERIALIZER"))
.registerType(TypeReference.of(RuntimeFieldType.class), builder -> builder.withField("_DESERIALIZER"))
.registerType(TypeReference.of(TypeMapping.class), builder -> builder.withField("_DESERIALIZER"));
hints.serialization() //
.registerType(org.apache.http.impl.auth.BasicScheme.class) //
.registerType(org.apache.http.impl.auth.RFC2617Scheme.class) //
.registerType(java.util.HashMap.class) //
;
if (ClassUtils.isPresent("org.apache.http.impl.auth.BasicScheme",
ElasticsearchClientRuntimeHints.class.getClassLoader())) {
hints.serialization()
.registerType(org.apache.http.impl.auth.BasicScheme.class)
.registerType(org.apache.http.impl.auth.RFC2617Scheme.class)
.registerType(java.util.HashMap.class);
}
hints.resources() //
.registerPattern("co/elastic/clients/version.properties") //
;
.registerPattern("co/elastic/clients/version.properties");
}
}
@@ -438,8 +438,8 @@ public class UpdateQuery {
public UpdateQuery build() {
if (script == null && document == null && query == null) {
throw new IllegalArgumentException("either script, document or query must be set");
if (script == null && scriptName == null && document == null && query == null) {
throw new IllegalArgumentException("either script, scriptName, document or query must be set");
}
return new UpdateQuery(id, script, params, document, upsert, lang, routing, scriptedUpsert, docAsUpsert,
+2 -1
View File
@@ -1,4 +1,4 @@
Spring Data Elasticsearch 6.0 GA (2025.1.0)
Spring Data Elasticsearch 6.0.1 (2025.1.1)
Copyright (c) [2013-2022] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -16,3 +16,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
@@ -21,14 +21,16 @@ import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;
import org.springframework.data.elasticsearch.core.query.RepositoryPartQueryIntegrationTests;
import org.springframework.data.elasticsearch.core.query.Query;
import org.springframework.data.elasticsearch.core.query.RepositoryPartQueryIntegrationTests;
import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration;
import org.springframework.test.context.ContextConfiguration;
/**
* @author Peter-Josef Meisch
* @since 4.4
*/
@ContextConfiguration(classes = ElasticsearchPartQueryELCIntegrationTests.Config.class)
public class ElasticsearchPartQueryELCIntegrationTests extends RepositoryPartQueryIntegrationTests {
@Configuration
@@ -21,11 +21,13 @@ import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
import org.springframework.data.elasticsearch.utils.IndexNameProvider;
import org.springframework.test.context.ContextConfiguration;
/**
* @author Peter-Josef Meisch
* @since 4.4
*/
@ContextConfiguration(classes = EnableRepositoriesELCIntegrationTests.Config.class)
public class EnableRepositoriesELCIntegrationTests extends EnableRepositoriesIntegrationTests {
@Configuration
@@ -4,8 +4,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration;
import org.springframework.test.context.ContextConfiguration;
@ContextConfiguration(classes = { IndexSettingsELCIntegrationTests.Config.class })
public class IndexSettingsELCIntegrationTests extends IndexSettingsIntegrationTests {
@Configuration
@Import({ ElasticsearchTemplateConfiguration.class })
static class Config {
@@ -14,4 +17,5 @@ public class IndexSettingsELCIntegrationTests extends IndexSettingsIntegrationTe
return new SpelSettingPath();
}
}
}
@@ -0,0 +1,45 @@
package org.springframework.data.elasticsearch.core.query;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.data.elasticsearch.core.document.Document;
class UpdateQueryTest {
@Test // #3205
@DisplayName("should build query with only a script")
void shouldBuildQueryWithOnlyAScript() {
UpdateQuery.builder("id")
.withScript("script")
.build();
}
@Test // #3205
@DisplayName("should build query with only a scriptname")
void shouldBuildQueryWithOnlyAScriptName() {
UpdateQuery.builder("id")
.withScriptName("scriptname")
.build();
}
@Test // #3205
@DisplayName("should build query with only a document")
void shouldBuildQueryWithOnlyASDocument() {
UpdateQuery.builder("id")
.withDocument(Document.create())
.build();
}
@Test // #3205
@DisplayName("should build query with only a query")
void shouldBuildQueryWithOnlyAQuery() {
Query query = StringQuery.builder("StrignQuery").build();
UpdateQuery.builder(query)
.build();
}
}
@@ -15,7 +15,7 @@
#
#
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
sde.testcontainers.image-version=9.2.1
sde.testcontainers.image-version=9.2.2
#
#
# 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