From de423a2497b88b8b78f8e3903b100ed461e32d2c Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 13 Sep 2024 14:51:02 -0400 Subject: [PATCH] Dependency updates: Spring Boot 3.4.0, Spring Framework 6.2, Spring Data Elasticsearch 5.4.0 Signed-off-by: Andriy Redko --- README.md | 1 + settings.gradle.kts | 14 ++++++++++---- .../data/client/orhlc/OpenSearchRestTemplate.java | 7 +++++++ .../data/client/osc/OpenSearchTemplate.java | 7 +++++++ .../core/index/MappingBuilderIntegrationTests.java | 12 +++++++++--- version.properties | 2 +- 6 files changed, 35 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3f9cb13..9965db7 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ The Spring Data OpenSearch follows the release model of the Spring Data Elastics | Spring Data Release Train | Spring Data OpenSearch | Spring Data Elasticsearch | OpenSearch Server | OpenSearch Client | Spring Framework | Spring Boot | |---------------------------|------------------------|---------------------------|-------------------|-------------------|------------------|---------------| +| 2024.1 | 1.6.x | 5.4.x | 1.x / 2.x | 2.10.x and above | 6.2.x | 3.4.x | | 2024.0 | 1.5.x | 5.3.x | 1.x / 2.x | 2.10.x and above | 6.1.x | 3.2.x / 3.3.x | | 2023.1 (Vaughan) | 1.4.x | 5.2.x | 1.x / 2.x | 2.10.x and above | 6.1.x | 3.2.x | | 2023.1 (Vaughan) | 1.3.x | 5.2.x | 1.x / 2.x | 2.7.x and above | 6.1.x | 3.2.x | diff --git a/settings.gradle.kts b/settings.gradle.kts index f36856f..4dc036b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,10 +14,10 @@ dependencyResolutionManagement { } create("springLibs") { - version("spring", "6.1.12") - version("spring-boot", "3.3.3") - library("data-commons", "org.springframework.data:spring-data-commons:3.3.3") - library("data-elasticsearch", "org.springframework.data:spring-data-elasticsearch:5.3.3") + version("spring", "6.2.0-RC1") + version("spring-boot", "3.4.0-M2") + library("data-commons", "org.springframework.data:spring-data-commons:3.4.0-M1") + library("data-elasticsearch", "org.springframework.data:spring-data-elasticsearch:5.4.0-M1") library("web", "org.springframework", "spring-web").versionRef("spring") library("context", "org.springframework", "spring-context").versionRef("spring") library("tx", "org.springframework", "spring-tx").versionRef("spring") @@ -72,12 +72,18 @@ pluginManagement { maven { url = uri("https://repo.spring.io/release/") } + maven { + url = uri("https://repo.spring.io/milestone/") + } } } dependencyResolutionManagement { repositories { mavenCentral() + maven { + url = uri("https://repo.spring.io/milestone/") + } } } diff --git a/spring-data-opensearch/src/main/java/org/opensearch/data/client/orhlc/OpenSearchRestTemplate.java b/spring-data-opensearch/src/main/java/org/opensearch/data/client/orhlc/OpenSearchRestTemplate.java index 92a0297..bc562e2 100644 --- a/spring-data-opensearch/src/main/java/org/opensearch/data/client/orhlc/OpenSearchRestTemplate.java +++ b/spring-data-opensearch/src/main/java/org/opensearch/data/client/orhlc/OpenSearchRestTemplate.java @@ -71,10 +71,12 @@ import org.springframework.data.elasticsearch.core.query.IndexQuery; import org.springframework.data.elasticsearch.core.query.MoreLikeThisQuery; import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.data.elasticsearch.core.query.SqlQuery; import org.springframework.data.elasticsearch.core.query.UpdateQuery; import org.springframework.data.elasticsearch.core.query.UpdateResponse; import org.springframework.data.elasticsearch.core.reindex.ReindexRequest; import org.springframework.data.elasticsearch.core.reindex.ReindexResponse; +import org.springframework.data.elasticsearch.core.sql.SqlResponse; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -631,6 +633,11 @@ protected MultiSearchResponse.Item[] getMultiSearchResult(MultiSearchRequest req return items; } + @Override + public SqlResponse search(SqlQuery query) { + throw new UnsupportedOperationException("The operation search(SqlQuery query) is not supported"); + } + // endregion // region ClientCallback diff --git a/spring-data-opensearch/src/main/java/org/opensearch/data/client/osc/OpenSearchTemplate.java b/spring-data-opensearch/src/main/java/org/opensearch/data/client/osc/OpenSearchTemplate.java index ba071c3..823d95b 100644 --- a/spring-data-opensearch/src/main/java/org/opensearch/data/client/osc/OpenSearchTemplate.java +++ b/spring-data-opensearch/src/main/java/org/opensearch/data/client/osc/OpenSearchTemplate.java @@ -59,11 +59,13 @@ import org.springframework.data.elasticsearch.core.query.MoreLikeThisQuery; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; +import org.springframework.data.elasticsearch.core.query.SqlQuery; import org.springframework.data.elasticsearch.core.query.UpdateQuery; import org.springframework.data.elasticsearch.core.query.UpdateResponse; import org.springframework.data.elasticsearch.core.reindex.ReindexRequest; import org.springframework.data.elasticsearch.core.reindex.ReindexResponse; import org.springframework.data.elasticsearch.core.script.Script; +import org.springframework.data.elasticsearch.core.sql.SqlResponse; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -642,6 +644,11 @@ public List listPointInTime() { .toList(); } + @Override + public SqlResponse search(SqlQuery query) { + throw new UnsupportedOperationException("The operation search(SqlQuery query) is not supported"); + } + // endregion // region script methods diff --git a/spring-data-opensearch/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/spring-data-opensearch/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index 8804b46..698a419 100644 --- a/spring-data-opensearch/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/spring-data-opensearch/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -37,6 +37,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.opensearch.data.client.EnabledIfOpenSearchVersion; import org.opensearch.data.client.junit.jupiter.OpenSearchRestTemplateConfiguration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -92,6 +93,13 @@ void setUp() { void cleanup() { operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete(); } + + @Test + @EnabledIfOpenSearchVersion(onOrAfter = "2.15.0", reason = "https://github.com/opensearch-project/OpenSearch/issues/5639") + public void shouldSupportAllTypes() { + IndexOperations indexOperations = operations.indexOps(EntityWithAllTypes.class); + indexOperations.createWithMapping(); + } @Test public void shouldNotFailOnCircularReference() { @@ -853,7 +861,7 @@ private static class EntityWithAllTypes { @Nullable @Field(type = FieldType.Percolator) String percolatorField; @Nullable - @Field(type = FieldType.Flattened) String flattenedField; + @Field(type = FieldType.Flattened, mappedTypeName = "flat_object") String flattenedField; @Nullable @Field(type = FieldType.Search_As_You_Type) String searchAsYouTypeField; @Nullable @@ -862,8 +870,6 @@ private static class EntityWithAllTypes { @Field(type = FieldType.Rank_Features) String rankFeaturesField; @Nullable @Field(type = FieldType.Wildcard) String wildcardField; - @Nullable - @Field(type = FieldType.Dense_Vector, dims = 1) String denseVectorField; } // endregion } diff --git a/version.properties b/version.properties index 39b3f38..21d8ccd 100644 --- a/version.properties +++ b/version.properties @@ -1 +1 @@ -version=1.5.3 +version=1.6.0