From 1d89054d121f491f0687a8280535c1820508d9a6 Mon Sep 17 00:00:00 2001 From: Mingron <41795715+1autodidact@users.noreply.github.com> Date: Sat, 27 Apr 2024 17:13:58 +0800 Subject: [PATCH 001/131] fix scripted-and-runtime-fields.adoc Original Pull Request #2902 Closes #2903 --- .../ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc index 7c5d730e2..38345d424 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc @@ -194,7 +194,7 @@ In the following code this is used to run a query for a given gender and maximum var runtimeField = new RuntimeField("age", "long", """ <.> Instant currentDate = Instant.ofEpochMilli(new Date().getTime()); - Instant startDate = doc['birth-date'].value.toInstant(); + Instant startDate = doc['birthDate'].value.toInstant(); emit (ChronoUnit.DAYS.between(startDate, currentDate) / 365); """); From dc5bf5a606232be18d027c4ace19d0e031675938 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 4 May 2024 09:46:41 +0200 Subject: [PATCH 002/131] Add the filter parts of a CriteriaQuery to the query, not as post-filter. Original Pull Request #2906 Closes #2857 --- .../client/elc/CriteriaFilterProcessor.java | 10 +++-- .../client/elc/CriteriaQueryProcessor.java | 25 ++++++++---- .../client/elc/RequestConverter.java | 18 ++++----- .../query/NativeQueryIntegrationTests.java | 40 +++++++++++++++++++ .../QueryKeywordsIntegrationTests.java | 35 ---------------- .../utils/IndexNameProvider.java | 8 +++- 6 files changed, 77 insertions(+), 59 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java index 8d56aebc4..140f87ac5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java @@ -70,9 +70,13 @@ public static Optional createQuery(Criteria criteria) { for (Criteria chainedCriteria : criteria.getCriteriaChain()) { if (chainedCriteria.isOr()) { - BoolQuery.Builder boolQueryBuilder = QueryBuilders.bool(); - queriesForEntries(chainedCriteria).forEach(boolQueryBuilder::should); - filterQueries.add(new Query(boolQueryBuilder.build())); + Collection queriesForEntries = queriesForEntries(chainedCriteria); + + if (!queriesForEntries.isEmpty()) { + BoolQuery.Builder boolQueryBuilder = QueryBuilders.bool(); + queriesForEntries.forEach(boolQueryBuilder::should); + filterQueries.add(new Query(boolQueryBuilder.build())); + } } else if (chainedCriteria.isNegating()) { Assert.notNull(criteria.getField(), "criteria must have a field"); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java index b18f6d405..435ba9a70 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java @@ -29,6 +29,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.core.query.Criteria; @@ -115,11 +116,18 @@ public static Query createQuery(Criteria criteria) { } } + var filterQuery = CriteriaFilterProcessor.createQuery(criteria); if (shouldQueries.isEmpty() && mustNotQueries.isEmpty() && mustQueries.isEmpty()) { - return null; + + if (filterQuery.isEmpty()) { + return null; + } + + // we need something to add the filter to + mustQueries.add(Query.of(qb -> qb.matchAll(m -> m))); } - Query query = new Query.Builder().bool(boolQueryBuilder -> { + return new Query.Builder().bool(boolQueryBuilder -> { if (!shouldQueries.isEmpty()) { boolQueryBuilder.should(shouldQueries); @@ -133,10 +141,10 @@ public static Query createQuery(Criteria criteria) { boolQueryBuilder.must(mustQueries); } + filterQuery.ifPresent(boolQueryBuilder::filter); + return boolQueryBuilder; }).build(); - - return query; } @Nullable @@ -238,7 +246,7 @@ private static Query.Builder queryFor(Criteria.CriteriaEntry entry, Field field, queryBuilder.queryString(queryStringQuery(fieldName, '*' + searchText, true, boost)); break; case EXPRESSION: - queryBuilder.queryString(queryStringQuery(fieldName, value.toString(), boost)); + queryBuilder.queryString(queryStringQuery(fieldName, Objects.requireNonNull(value).toString(), boost)); break; case LESS: queryBuilder // @@ -270,6 +278,7 @@ private static Query.Builder queryFor(Criteria.CriteriaEntry entry, Field field, break; case BETWEEN: Object[] ranges = (Object[]) value; + Assert.notNull(value, "value for a between condition must not be null"); queryBuilder // .range(rb -> { rb.field(fieldName); @@ -293,10 +302,10 @@ private static Query.Builder queryFor(Criteria.CriteriaEntry entry, Field field, .boost(boost)); // break; case MATCHES: - queryBuilder.match(matchQuery(fieldName, value.toString(), Operator.Or, boost)); + queryBuilder.match(matchQuery(fieldName, Objects.requireNonNull(value).toString(), Operator.Or, boost)); break; case MATCHES_ALL: - queryBuilder.match(matchQuery(fieldName, value.toString(), Operator.And, boost)); + queryBuilder.match(matchQuery(fieldName, Objects.requireNonNull(value).toString(), Operator.And, boost)); break; case IN: @@ -345,7 +354,7 @@ private static Query.Builder queryFor(Criteria.CriteriaEntry entry, Field field, queryBuilder // .regexp(rb -> rb // .field(fieldName) // - .value(value.toString()) // + .value(Objects.requireNonNull(value).toString()) // .boost(boost)); // break; case HAS_CHILD: 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 50efe0823..c0fa6d932 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 @@ -1210,7 +1210,7 @@ public SearchRequest searchRequest(Query query, @Nullable String routing, @N builder.routing(routing); } - addFilter(query, builder); + addPostFilter(query, builder); return builder.build(); } @@ -1758,22 +1758,18 @@ co.elastic.clients.elasticsearch._types.query_dsl.Query getQuery(@Nullable Query return getEsQuery(query, (q) -> elasticsearchConverter.updateQuery(q, clazz)); } - private void addFilter(Query query, SearchRequest.Builder builder) { + @SuppressWarnings("StatementWithEmptyBody") + private void addPostFilter(Query query, SearchRequest.Builder builder) { - if (query instanceof CriteriaQuery) { - CriteriaFilterProcessor.createQuery(((CriteriaQuery) query).getCriteria()).ifPresent(builder::postFilter); - } else // noinspection StatementWithEmptyBody - if (query instanceof StringQuery) { - // no filter for StringQuery - } else if (query instanceof NativeQuery nativeQuery) { + // we only need to handle NativeQuery here. filter from a CriteriaQuery are added into the query and not as post + // filter anymore, StringQuery do not have post filters + if (query instanceof NativeQuery nativeQuery) { if (nativeQuery.getFilter() != null) { builder.postFilter(nativeQuery.getFilter()); } else if (nativeQuery.getSpringDataQuery() != null) { - addFilter(nativeQuery.getSpringDataQuery(), builder); + addPostFilter(nativeQuery.getSpringDataQuery(), builder); } - } else { - throw new IllegalArgumentException("unhandled Query implementation " + query.getClass().getName()); } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java index 579b22ffe..a03bc9348 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java @@ -17,6 +17,11 @@ import static org.assertj.core.api.Assertions.*; +import co.elastic.clients.elasticsearch._types.GeoHashPrecision; +import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; + +import java.util.List; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -26,6 +31,7 @@ import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.client.elc.ElasticsearchAggregation; import org.springframework.data.elasticsearch.client.elc.NativeQuery; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.geo.GeoPoint; @@ -98,6 +104,40 @@ void shouldBeAbleToUseCriteriaQueryWithFilterArgumentsInANativeQuery() { assertThat(searchHits.getSearchHit(0).getId()).isEqualTo(entity1.getId()); } + @Test // #2857 + @DisplayName("should apply CriteriaQuery with filter arguments in a NativeQuery to aggregations") + void shouldBeAbleToUseCriteriaQueryWithFilterArgumentsInANativeQueryToAggregations() { + var entity1 = new SampleEntity(); + entity1.setId("60"); + var location1 = new GeoPoint(60.0, 60.0); + entity1.setLocation(location1); + entity1.setText("60"); + var entity2 = new SampleEntity(); + entity2.setId("70"); + entity2.setText("70"); + var location70 = new GeoPoint(70.0, 70.0); + entity2.setLocation(location70); + operations.save(entity1, entity2); + + var criteriaQuery = new CriteriaQuery(Criteria.where("location").within(location1, "10km")); + var nativeQuery = NativeQuery.builder() + .withQuery(criteriaQuery) + .withAggregation("geohashgrid", Aggregation.of(ab -> ab + .geohashGrid(ghg -> ghg + .field("location") + .precision(GeoHashPrecision.of(ghp -> ghp.distance("10000km")))))) + .build(); + + var searchHits = operations.search(nativeQuery, SampleEntity.class); + + assertThat(searchHits.getTotalHits()).isEqualTo(1); + assertThat(searchHits.getSearchHit(0).getId()).isEqualTo(entity1.getId()); + assertThat(searchHits.getAggregations()).isNotNull(); + // noinspection unchecked + var aggregations = (List) searchHits.getAggregations().aggregations(); + assertThat(aggregations).hasSize(1); + } + @Test // #2391 @DisplayName("should be able to use StringQuery in a NativeQuery") void shouldBeAbleToUseStringQueryInANativeQuery() { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java index 1bb15c09e..757484e73 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java @@ -79,11 +79,6 @@ void cleanup() { @Test public void shouldSupportAND() { - // given - - // when - - // then assertThat(repository.findByNameAndText("Sugar", "Cane sugar")).hasSize(2); assertThat(repository.findByNameAndPrice("Sugar", 1.1f)).hasSize(1); } @@ -91,11 +86,6 @@ public void shouldSupportAND() { @Test public void shouldSupportOR() { - // given - - // when - - // then assertThat(repository.findByNameOrPrice("Sugar", 1.9f)).hasSize(4); assertThat(repository.findByNameOrText("Salt", "Beet sugar")).hasSize(3); } @@ -103,11 +93,6 @@ public void shouldSupportOR() { @Test public void shouldSupportTrueAndFalse() { - // given - - // when - - // then assertThat(repository.findByAvailableTrue()).hasSize(3); assertThat(repository.findByAvailableFalse()).hasSize(4); } @@ -115,11 +100,6 @@ public void shouldSupportTrueAndFalse() { @Test public void shouldSupportInAndNotInAndNot() { - // given - - // when - - // then assertThat(repository.findByPriceIn(Arrays.asList(1.2f, 1.1f))).hasSize(2); assertThat(repository.findByPriceNotIn(Arrays.asList(1.2f, 1.1f))).hasSize(5); assertThat(repository.findByPriceNot(1.2f)).hasSize(6); @@ -128,33 +108,18 @@ public void shouldSupportInAndNotInAndNot() { @Test // DATAES-171 public void shouldWorkWithNotIn() { - // given - - // when - - // then assertThat(repository.findByIdNotIn(Arrays.asList("2", "3"))).hasSize(5); } @Test public void shouldSupportBetween() { - // given - - // when - - // then assertThat(repository.findByPriceBetween(1.0f, 2.0f)).hasSize(4); } @Test public void shouldSupportLessThanAndGreaterThan() { - // given - - // when - - // then assertThat(repository.findByPriceLessThan(1.1f)).hasSize(1); assertThat(repository.findByPriceLessThanEqual(1.1f)).hasSize(2); diff --git a/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java b/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java index 0b19964af..5a4820edd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java +++ b/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java @@ -16,7 +16,7 @@ package org.springframework.data.elasticsearch.utils; /** - * Class providing an index name with a prefix and an index number + * Class providing an index name with a prefix, an index number and a random 6-digit number. * * @author Peter-Josef Meisch */ @@ -35,7 +35,7 @@ public IndexNameProvider(String prefix) { } public void increment() { - indexName = prefix + '-' + ++idx; + indexName = prefix + '-' + ++idx + '-' + sixDigits(); } public String indexName() { @@ -48,4 +48,8 @@ public String indexName() { public String getPrefix() { return prefix; } + + private String sixDigits() { + return String.valueOf((int) (100000 + Math.random() * 900000)); + } } From 94a40a7a752b6cf797d3e75fffe128f77f1c8468 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 10 May 2024 09:33:39 +0200 Subject: [PATCH 003/131] Fix implementation of explicit refresh policy. Original Pull Request #2908 Closes #2907 --- .../repository/support/SimpleElasticsearchRepository.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index c5c17d8a8..e4d1da6e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -457,9 +457,7 @@ public R executeAndRefresh(OperationsCallback callback) { @Nullable public R executeAndRefresh(OperationsCallback callback, @Nullable RefreshPolicy refreshPolicy) { - R result = callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); - doRefresh(); - return result; + return callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); } // endregion } From d693c4f81b81640cc69d18910a555e7454ea3f31 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 12 May 2024 17:38:17 +0200 Subject: [PATCH 004/131] Update README.adoc --- README.adoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 20cce0823..5864ee067 100644 --- a/README.adoc +++ b/README.adoc @@ -124,8 +124,7 @@ We’d love to help! https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/elasticsearch/docs/current/api/[Javadocs]. * Learn the Spring basics – Spring Data builds on Spring Framework, check the https://spring.io[spring.io] web-site for a wealth of reference documentation. If you are just starting out with Spring, try one of the https://spring.io/guides[guides]. -* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-data[`spring-data-elasticsearch`]. -You can also chat with the community on https://gitter.im/spring-projects/spring-data[Gitter]. +* Ask a question or chat with the community on https://app.gitter.im/#/room/#spring-projects_spring-data:gitter.im[Gitter]. * Report bugs with Spring Data for Elasticsearch at https://github.com/spring-projects/spring-data-elasticsearch/issues[https://github.com/spring-projects/spring-data-elasticsearch/issues]. == Reporting Issues From baec1f14196cd59ea5b338a373b2f5f9ea01d2e7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 17 May 2024 11:49:11 +0200 Subject: [PATCH 005/131] Prepare 5.3 GA (2024.0.0). See #2896 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index a564adf40..48bfbe807 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.3.0-SNAPSHOT + 3.3.0 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.3.0-SNAPSHOT + 3.3.0 8.13.2 @@ -488,20 +488,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index b8703eeb3..8cee1fd55 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.3 RC1 (2024.0.0) +Spring Data Elasticsearch 5.3 GA (2024.0.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -21,3 +21,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 2b767620079fe9e7477582bc3804ece12b0881b7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 17 May 2024 11:49:25 +0200 Subject: [PATCH 006/131] Release version 5.3 GA (2024.0.0). See #2896 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 48bfbe807..cd745fe21 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.3.0-SNAPSHOT + 5.3.0 org.springframework.data.build From 82c4ea13912beff1106c25952671a94ea7c3f5df Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 17 May 2024 11:51:33 +0200 Subject: [PATCH 007/131] Prepare next development iteration. See #2896 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cd745fe21..4d8e1c98b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.3.0 + 5.4.0-SNAPSHOT org.springframework.data.build From 41e32576e3491243df07de2bdd00c5e28288a8dd Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 17 May 2024 11:51:34 +0200 Subject: [PATCH 008/131] After release cleanups. See #2896 --- pom.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 4d8e1c98b..7188db3aa 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.3.0 + 3.4.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.3.0 + 3.4.0-SNAPSHOT 8.13.2 @@ -488,8 +488,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From e997b39f68bc0967c06c27a43e52b83afdb0b522 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 18 May 2024 18:11:43 +0200 Subject: [PATCH 009/131] Fix max dim value for dense vector. Closes #2911 --- .../core/index/MappingParameters.java | 8 +++--- .../core/index/MappingParametersTest.java | 27 ++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java index 72fa129bc..595cc6bd6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java @@ -171,8 +171,8 @@ private MappingParameters(Field field) { positiveScoreImpact = field.positiveScoreImpact(); dims = field.dims(); if (type == FieldType.Dense_Vector) { - Assert.isTrue(dims >= 1 && dims <= 2048, - "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 2048."); + Assert.isTrue(dims >= 1 && dims <= 4096, + "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096."); } Assert.isTrue(field.enabled() || type == FieldType.Object, "enabled false is only allowed for field type object"); enabled = field.enabled(); @@ -214,8 +214,8 @@ private MappingParameters(InnerField field) { positiveScoreImpact = field.positiveScoreImpact(); dims = field.dims(); if (type == FieldType.Dense_Vector) { - Assert.isTrue(dims >= 1 && dims <= 2048, - "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 2048."); + Assert.isTrue(dims >= 1 && dims <= 4096, + "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096."); } enabled = true; eagerGlobalOrdinals = field.eagerGlobalOrdinals(); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java index a572ab747..7d424d049 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java @@ -70,8 +70,8 @@ void shouldAllowEnabledFalseOnlyOnObjectFields() { } @Test // #1700 - @DisplayName("should not allow dims length greater than 2048 for dense_vector type") - void shouldNotAllowDimsLengthGreaterThan2048ForDenseVectorType() { + @DisplayName("should not allow dims length greater than 4096 for dense_vector type") + void shouldNotAllowDimsLengthGreaterThan4096ForDenseVectorType() { ElasticsearchPersistentEntity failEntity = elasticsearchConverter.get().getMappingContext() .getRequiredPersistentEntity(DenseVectorInvalidDimsClass.class); Annotation annotation = failEntity.getRequiredPersistentProperty("dense_vector").findAnnotation(Field.class); @@ -90,21 +90,28 @@ void shouldRequireDimsParameterForDenseVectorType() { } static class AnnotatedClass { - @Nullable @Field private String field; - @Nullable @MultiField(mainField = @Field, + @Nullable + @Field private String field; + @Nullable + @MultiField(mainField = @Field, otherFields = { @InnerField(suffix = "test", type = FieldType.Text) }) private String mainField; - @Nullable @Field(type = FieldType.Text, docValues = false) private String docValuesText; - @Nullable @Field(type = FieldType.Nested, docValues = false) private String docValuesNested; - @Nullable @Field(type = Object, enabled = true) private String enabledObject; - @Nullable @Field(type = Object, enabled = false) private String disabledObject; + @Nullable + @Field(type = FieldType.Text, docValues = false) private String docValuesText; + @Nullable + @Field(type = FieldType.Nested, docValues = false) private String docValuesNested; + @Nullable + @Field(type = Object, enabled = true) private String enabledObject; + @Nullable + @Field(type = Object, enabled = false) private String disabledObject; } static class InvalidEnabledFieldClass { - @Nullable @Field(type = FieldType.Text, enabled = false) private String disabledObject; + @Nullable + @Field(type = FieldType.Text, enabled = false) private String disabledObject; } static class DenseVectorInvalidDimsClass { - @Field(type = Dense_Vector, dims = 2049) private float[] dense_vector; + @Field(type = Dense_Vector, dims = 4097) private float[] dense_vector; } static class DenseVectorMissingDimsClass { From 5ebe9f44924848b4003ffa40ba4874d24a853ea8 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 18 May 2024 19:15:02 +0200 Subject: [PATCH 010/131] Update version document. --- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 8fe2fc70e..a4f0b8181 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,7 +6,8 @@ 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 -| 2024.0 (?) | 5.3.x | 8.13.2 | ? +| 2024.1 (in development) | 5.3.x | 8.13.2 | 6.1.x +| 2024.0 | 5.3.x | 8.13.2 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x | 2022.0 (Turing) | 5.0.xfootnote:oom[Out of maintenance] | 8.5.3 | 6.0.x From 86e0e660be0c183ab8f37946f34e30025435143c Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 19 May 2024 11:48:34 +0200 Subject: [PATCH 011/131] Upgrade to Elasticsearch 8.13.4. Original Pull Request #2918 Closes #2915 --- pom.xml | 2 +- .../elasticsearch/elasticsearch-new.adoc | 5 ++++ .../ROOT/pages/elasticsearch/versions.adoc | 4 +-- .../elasticsearch/client/elc/NativeQuery.java | 11 ++++++++ .../client/elc/NativeQueryBuilder.java | 11 ++++++++ .../client/elc/RequestConverter.java | 26 +++++++++++++++++-- .../testcontainers-elasticsearch.properties | 2 +- 7 files changed, 55 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 7188db3aa..f3098645c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.13.2 + 8.13.4 1.0.8.RELEASE 0.14.4 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 e9705e4db..16a297531 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -1,6 +1,11 @@ [[new-features]] = What's new +[[new-features.5-4-0]] +== New in Spring Data Elasticsearch 5.4 + +* Upgrade to Elasticsearch 8.13.4. + [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index a4f0b8181..1a6dd4e52 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,8 +6,8 @@ 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 -| 2024.1 (in development) | 5.3.x | 8.13.2 | 6.1.x -| 2024.0 | 5.3.x | 8.13.2 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.13.4 | 6.1.x +| 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x | 2022.0 (Turing) | 5.0.xfootnote:oom[Out of maintenance] | 8.5.3 | 6.0.x diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java index 880cb7ae0..f1b5fdc24 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java @@ -16,6 +16,7 @@ package org.springframework.data.elasticsearch.client.elc; import co.elastic.clients.elasticsearch._types.KnnQuery; +import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.SortOptions; import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; import co.elastic.clients.elasticsearch._types.query_dsl.Query; @@ -54,6 +55,7 @@ public class NativeQuery extends BaseQuery { private Map searchExtensions = Collections.emptyMap(); @Nullable private KnnQuery knnQuery; + @Nullable private List knnSearches = Collections.emptyList(); public NativeQuery(NativeQueryBuilder builder) { super(builder); @@ -71,6 +73,7 @@ public NativeQuery(NativeQueryBuilder builder) { } this.springDataQuery = builder.getSpringDataQuery(); this.knnQuery = builder.getKnnQuery(); + this.knnSearches = builder.getKnnSearches(); } public NativeQuery(@Nullable Query query) { @@ -129,6 +132,14 @@ public KnnQuery getKnnQuery() { return knnQuery; } + /** + * @since 5.3.1 + */ + @Nullable + public List getKnnSearches() { + return knnSearches; + } + @Nullable public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() { return springDataQuery; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java index d290dd782..1956a75ea 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java @@ -16,6 +16,7 @@ package org.springframework.data.elasticsearch.client.elc; import co.elastic.clients.elasticsearch._types.KnnQuery; +import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.SortOptions; import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; import co.elastic.clients.elasticsearch._types.query_dsl.Query; @@ -26,6 +27,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -52,6 +54,7 @@ public class NativeQueryBuilder extends BaseQueryBuilder knnSearches = Collections.emptyList(); public NativeQueryBuilder() {} @@ -92,6 +95,14 @@ public KnnQuery getKnnQuery() { return knnQuery; } + /** + * @since 5.3.1 + */ + @Nullable + public List getKnnSearches() { + return knnSearches; + } + @Nullable public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() { return springDataQuery; 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 c0fa6d932..c0aafd60e 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 @@ -1719,7 +1719,18 @@ private void prepareNativeSearch(NativeQuery query, SearchRequest.Builder builde ; if (query.getKnnQuery() != null) { - builder.knn(query.getKnnQuery()); + var kq = query.getKnnQuery(); + builder.knn(ksb -> ksb + .field(kq.field()) + .queryVector(kq.queryVector()) + .numCandidates(kq.numCandidates()) + .filter(kq.filter()) + .similarity(kq.similarity())); + + } + + if (!isEmpty(query.getKnnSearches())) { + builder.knn(query.getKnnSearches()); } if (!isEmpty(query.getAggregations())) { @@ -1740,7 +1751,18 @@ private void prepareNativeSearch(NativeQuery query, MultisearchBody.Builder buil .sort(query.getSortOptions()); if (query.getKnnQuery() != null) { - builder.knn(query.getKnnQuery()); + var kq = query.getKnnQuery(); + builder.knn(ksb -> ksb + .field(kq.field()) + .queryVector(kq.queryVector()) + .numCandidates(kq.numCandidates()) + .filter(kq.filter()) + .similarity(kq.similarity())); + + } + + if (!isEmpty(query.getKnnSearches())) { + builder.knn(query.getKnnSearches()); } if (!isEmpty(query.getAggregations())) { diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 487a77738..669b532c0 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.13.2 +sde.testcontainers.image-version=8.13.4 # # # 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 From fbe54e485bba831dde3fa9bbf1f153ad19e350c6 Mon Sep 17 00:00:00 2001 From: Aouichaoui Youssef <21143371+youssef3wi@users.noreply.github.com> Date: Sun, 26 May 2024 20:16:21 +0200 Subject: [PATCH 012/131] Add support for index aliases. Original Pull Request #2905 Closes #2599 --- .../data/elasticsearch/annotations/Alias.java | 80 ++++++ .../elasticsearch/annotations/Aliases.java | 37 +++ .../elasticsearch/annotations/Document.java | 7 + .../elasticsearch/annotations/Filter.java | 39 +++ .../client/elc/IndicesTemplate.java | 25 +- .../client/elc/ReactiveIndicesTemplate.java | 22 +- .../client/elc/RequestConverter.java | 28 ++- .../elasticsearch/core/mapping/Alias.java | 232 ++++++++++++++++++ .../core/mapping/CreateIndexSettings.java | 117 +++++++++ .../ElasticsearchPersistentEntity.java | 10 + .../SimpleElasticsearchPersistentEntity.java | 43 ++++ .../IndexOperationsIntegrationTests.java | 58 +++++ ...activeIndexOperationsIntegrationTests.java | 61 +++++ 13 files changed, 743 insertions(+), 16 deletions(-) create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java new file mode 100644 index 000000000..0fd1e3694 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java @@ -0,0 +1,80 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + + +import org.springframework.core.annotation.AliasFor; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Identifies an alias for the index. + * + * @author Youssef Aouichaoui + * @since 5.4 + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +@Repeatable(Aliases.class) +public @interface Alias { + /** + * @return Index alias name. Alias for {@link #alias}. + */ + @AliasFor("alias") + String value() default ""; + + /** + * @return Index alias name. Alias for {@link #value}. + */ + @AliasFor("value") + String alias() default ""; + + /** + * @return Query used to limit documents the alias can access. + */ + Filter filter() default @Filter; + + /** + * @return Used to route indexing operations to a specific shard. + */ + String indexRouting() default ""; + + /** + * @return Used to route indexing and search operations to a specific shard. + */ + String routing() default ""; + + /** + * @return Used to route search operations to a specific shard. + */ + String searchRouting() default ""; + + /** + * @return Is the alias hidden? + */ + boolean isHidden() default false; + + /** + * @return Is it the 'write index' for the alias? + */ + boolean isWriteIndex() default false; +} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java new file mode 100644 index 000000000..b72108210 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java @@ -0,0 +1,37 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Container annotation that aggregates several {@link Alias} annotations. + * + * @author Youssef Aouichaoui + * @see Alias + * @since 5.4 + */ +@Inherited +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE}) +public @interface Aliases { + Alias[] value(); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java index 391e303e0..fbe761e4c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java @@ -100,6 +100,13 @@ */ boolean storeVersionInSource() default true; + /** + * Aliases for the index. + * + * @since 5.4 + */ + Alias[] aliases() default {}; + /** * @since 4.3 */ diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java new file mode 100644 index 000000000..6d68e3813 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + + +import org.springframework.core.annotation.AliasFor; + +/** + * Query used to limit documents. + * + * @author Youssef Aouichaoui + * @since 5.4 + */ +public @interface Filter { + /** + * @return Query used to limit documents. Alias for {@link #query}. + */ + @AliasFor("query") + String value() default ""; + + /** + * @return Query used to limit documents. Alias for {@link #value}. + */ + @AliasFor("value") + String query() default ""; +} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java index ec6ea3914..c5a2d029c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java @@ -21,6 +21,7 @@ import co.elastic.clients.transport.ElasticsearchTransport; import co.elastic.clients.transport.endpoints.BooleanResponse; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; @@ -46,6 +47,8 @@ import org.springframework.data.elasticsearch.core.index.GetTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutIndexTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutTemplateRequest; +import org.springframework.data.elasticsearch.core.mapping.Alias; +import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.lang.Nullable; @@ -137,11 +140,14 @@ public boolean createWithMapping() { protected boolean doCreate(IndexCoordinates indexCoordinates, Map settings, @Nullable Document mapping) { - - Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); - Assert.notNull(settings, "settings must not be null"); - - CreateIndexRequest createIndexRequest = requestConverter.indicesCreateRequest(indexCoordinates, settings, mapping); + Set aliases = (boundClass != null) ? getAliasesFor(boundClass) : new HashSet<>(); + CreateIndexSettings indexSettings = CreateIndexSettings.builder(indexCoordinates) + .withAliases(aliases) + .withSettings(settings) + .withMapping(mapping) + .build(); + + CreateIndexRequest createIndexRequest = requestConverter.indicesCreateRequest(indexSettings); CreateIndexResponse createIndexResponse = execute(client -> client.create(createIndexRequest)); return Boolean.TRUE.equals(createIndexResponse.acknowledged()); } @@ -449,5 +455,14 @@ public IndexCoordinates getIndexCoordinates() { public IndexCoordinates getIndexCoordinatesFor(Class clazz) { return getRequiredPersistentEntity(clazz).getIndexCoordinates(); } + + /** + * Get the {@link Alias} of the provided class. + * + * @param clazz provided class that can be used to extract aliases. + */ + public Set getAliasesFor(Class clazz) { + return getRequiredPersistentEntity(clazz).getAliases(); + } // endregion } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java index 82f21f107..1c90c7a83 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java @@ -21,9 +21,12 @@ import co.elastic.clients.elasticsearch.indices.*; import co.elastic.clients.transport.ElasticsearchTransport; import co.elastic.clients.transport.endpoints.BooleanResponse; +import org.springframework.data.elasticsearch.core.mapping.Alias; +import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; @@ -130,8 +133,14 @@ public Mono createWithMapping() { private Mono doCreate(IndexCoordinates indexCoordinates, Map settings, @Nullable Document mapping) { - - CreateIndexRequest createIndexRequest = requestConverter.indicesCreateRequest(indexCoordinates, settings, mapping); + Set aliases = (boundClass != null) ? getAliasesFor(boundClass) : new HashSet<>(); + CreateIndexSettings indexSettings = CreateIndexSettings.builder(indexCoordinates) + .withAliases(aliases) + .withSettings(settings) + .withMapping(mapping) + .build(); + + CreateIndexRequest createIndexRequest = requestConverter.indicesCreateRequest(indexSettings); Mono createIndexResponse = Mono.from(execute(client -> client.create(createIndexRequest))); return createIndexResponse.map(CreateIndexResponse::acknowledged); } @@ -435,6 +444,15 @@ private IndexCoordinates getIndexCoordinatesFor(Class clazz) { return elasticsearchConverter.getMappingContext().getRequiredPersistentEntity(clazz).getIndexCoordinates(); } + /** + * Get the {@link Alias} of the provided class. + * + * @param clazz provided class that can be used to extract aliases. + */ + private Set getAliasesFor(Class clazz) { + return elasticsearchConverter.getMappingContext().getRequiredPersistentEntity(clazz).getAliases(); + } + private Class checkForBoundClass() { if (boundClass == null) { throw new InvalidDataAccessApiUsageException("IndexOperations are not bound"); 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 c0aafd60e..aef836ad2 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 @@ -88,6 +88,8 @@ import org.springframework.data.elasticsearch.core.index.GetTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutIndexTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutTemplateRequest; +import org.springframework.data.elasticsearch.core.mapping.Alias; +import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; @@ -170,7 +172,7 @@ public co.elastic.clients.elasticsearch.cluster.PutComponentTemplateRequest clus })); } - private Alias.Builder buildAlias(AliasActionParameters parameters, Alias.Builder aliasBuilder) { + private co.elastic.clients.elasticsearch.indices.Alias.Builder buildAlias(AliasActionParameters parameters, co.elastic.clients.elasticsearch.indices.Alias.Builder aliasBuilder) { if (parameters.getRouting() != null) { aliasBuilder.routing(parameters.getRouting()); @@ -234,17 +236,25 @@ public ExistsRequest indicesExistsRequest(IndexCoordinates indexCoordinates) { return new ExistsRequest.Builder().index(Arrays.asList(indexCoordinates.getIndexNames())).build(); } - public CreateIndexRequest indicesCreateRequest(IndexCoordinates indexCoordinates, Map settings, - @Nullable Document mapping) { - - Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); - Assert.notNull(settings, "settings must not be null"); + public CreateIndexRequest indicesCreateRequest(CreateIndexSettings indexSettings) { + Map aliases = new HashMap<>(); + for (Alias alias : indexSettings.getAliases()) { + co.elastic.clients.elasticsearch.indices.Alias esAlias = co.elastic.clients.elasticsearch.indices.Alias.of(ab -> ab.filter(getQuery(alias.getFilter(), null)) + .routing(alias.getRouting()) + .indexRouting(alias.getIndexRouting()) + .searchRouting(alias.getSearchRouting()) + .isHidden(alias.getHidden()) + .isWriteIndex(alias.getWriteIndex()) + ); + aliases.put(alias.getAlias(), esAlias); + } // note: the new client does not support the index.storeType anymore return new CreateIndexRequest.Builder() // - .index(indexCoordinates.getIndexName()) // - .settings(indexSettings(settings)) // - .mappings(typeMapping(mapping)) // + .index(indexSettings.getIndexCoordinates().getIndexName()) // + .aliases(aliases) + .settings(indexSettings(indexSettings.getSettings())) // + .mappings(typeMapping(indexSettings.getMapping())) // .build(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java new file mode 100644 index 000000000..bbaa62443 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java @@ -0,0 +1,232 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.mapping; + +import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.lang.Nullable; +import org.springframework.util.Assert; + +import java.util.Objects; + +/** + * Immutable Value object encapsulating index alias(es). + * + * @author Youssef Aouichaoui + * @since 5.4 + */ +public class Alias { + /** + * Alias name for the index. + */ + private final String alias; + + /** + * Query used to limit documents the alias can access. + */ + @Nullable + private final Query filter; + + /** + * Used to route indexing operations to a specific shard. + */ + @Nullable + private final String indexRouting; + + /** + * Used to route search operations to a specific shard. + */ + @Nullable + private final String searchRouting; + + /** + * Used to route indexing and search operations to a specific shard. + */ + @Nullable + private final String routing; + + /** + * The alias is hidden? + * By default, this is set to {@code false}. + */ + @Nullable + private final Boolean isHidden; + + /** + * The index is the 'write index' for the alias? + * By default, this is set to {@code false}. + */ + @Nullable + private final Boolean isWriteIndex; + + private Alias(Builder builder) { + this.alias = builder.alias; + + this.filter = builder.filter; + + this.indexRouting = builder.indexRouting; + this.searchRouting = builder.searchRouting; + this.routing = builder.routing; + + this.isHidden = builder.isHidden; + this.isWriteIndex = builder.isWriteIndex; + } + + public String getAlias() { + return alias; + } + + @Nullable + public Query getFilter() { + return filter; + } + + @Nullable + public String getIndexRouting() { + return indexRouting; + } + + @Nullable + public String getSearchRouting() { + return searchRouting; + } + + @Nullable + public String getRouting() { + return routing; + } + + @Nullable + public Boolean getHidden() { + return isHidden; + } + + @Nullable + public Boolean getWriteIndex() { + return isWriteIndex; + } + + public static Builder builder(String alias) { + return new Builder(alias); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Alias that)) return false; + + return Objects.equals(alias, that.alias) && Objects.equals(filter, that.filter) + && Objects.equals(indexRouting, that.indexRouting) + && Objects.equals(searchRouting, that.searchRouting) + && Objects.equals(routing, that.routing) + && Objects.equals(isHidden, that.isHidden) + && Objects.equals(isWriteIndex, that.isWriteIndex); + } + + @Override + public int hashCode() { + return Objects.hash(alias, filter, indexRouting, searchRouting, routing, isHidden, isWriteIndex); + } + + public static class Builder { + private final String alias; + + @Nullable + private Query filter; + + @Nullable + private String indexRouting; + @Nullable + private String searchRouting; + @Nullable + private String routing; + + @Nullable + private Boolean isHidden; + @Nullable + private Boolean isWriteIndex; + + public Builder(String alias) { + Assert.notNull(alias, "alias must not be null"); + this.alias = alias; + } + + /** + * Query used to limit documents the alias can access. + */ + public Builder withFilter(@Nullable Query filter) { + this.filter = filter; + + return this; + } + + /** + * Used to route indexing operations to a specific shard. + */ + public Builder withIndexRouting(@Nullable String indexRouting) { + if (indexRouting != null && !indexRouting.trim().isEmpty()) { + this.indexRouting = indexRouting; + } + + return this; + } + + /** + * Used to route search operations to a specific shard. + */ + public Builder withSearchRouting(@Nullable String searchRouting) { + if (searchRouting != null && !searchRouting.trim().isEmpty()) { + this.searchRouting = searchRouting; + } + + return this; + } + + /** + * Used to route indexing and search operations to a specific shard. + */ + public Builder withRouting(@Nullable String routing) { + if (routing != null && !routing.trim().isEmpty()) { + this.routing = routing; + } + + return this; + } + + /** + * The alias is hidden? + * By default, this is set to {@code false}. + */ + public Builder withHidden(@Nullable Boolean hidden) { + isHidden = hidden; + + return this; + } + + /** + * The index is the 'write index' for the alias? + * By default, this is set to {@code false}. + */ + public Builder withWriteIndex(@Nullable Boolean writeIndex) { + isWriteIndex = writeIndex; + + return this; + } + + public Alias build() { + return new Alias(this); + } + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java new file mode 100644 index 000000000..1406626dd --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.mapping; + +import org.springframework.data.elasticsearch.core.document.Document; +import org.springframework.lang.Nullable; +import org.springframework.util.Assert; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Encapsulating index mapping fields, settings, and index alias(es). + * + * @author Youssef Aouichaoui + * @since 5.3 + */ +public class CreateIndexSettings { + private final IndexCoordinates indexCoordinates; + private final Set aliases; + + @Nullable + private final Map settings; + + @Nullable + private final Document mapping; + + private CreateIndexSettings(Builder builder) { + this.indexCoordinates = builder.indexCoordinates; + this.aliases = builder.aliases; + + this.settings = builder.settings; + this.mapping = builder.mapping; + } + + public static Builder builder(IndexCoordinates indexCoordinates) { + return new Builder(indexCoordinates); + } + + public IndexCoordinates getIndexCoordinates() { + return indexCoordinates; + } + + public Alias[] getAliases() { + return aliases.toArray(Alias[]::new); + } + + public Map getSettings() { + return settings; + } + + @Nullable + public Document getMapping() { + return mapping; + } + + public static class Builder { + private IndexCoordinates indexCoordinates; + private final Set aliases = new HashSet<>(); + + @Nullable + private Map settings; + + @Nullable + private Document mapping; + + public Builder(IndexCoordinates indexCoordinates) { + Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); + this.indexCoordinates = indexCoordinates; + } + + public Builder withAlias(Alias alias) { + Assert.notNull(alias, "alias must not be null"); + this.aliases.add(alias); + + return this; + } + + public Builder withAliases(Set aliases) { + Assert.notNull(aliases, "aliases must not be null"); + this.aliases.addAll(aliases); + + return this; + } + + public Builder withSettings(Map settings) { + Assert.notNull(settings, "settings must not be null"); + this.settings = settings; + + return this; + } + + public Builder withMapping(@Nullable Document mapping) { + this.mapping = mapping; + + return this; + } + + public CreateIndexSettings build() { + return new CreateIndexSettings(this); + } + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java index 6d13d7eb6..e9d3d0c7a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java @@ -25,6 +25,8 @@ import org.springframework.data.mapping.model.FieldNamingStrategy; import org.springframework.lang.Nullable; +import java.util.Set; + /** * ElasticsearchPersistentEntity * @@ -42,6 +44,14 @@ public interface ElasticsearchPersistentEntity extends PersistentEntity getAliases(); + short getShards(); short getReplicas(); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java index f265fa13d..4ff39850e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java @@ -15,7 +15,9 @@ */ package org.springframework.data.elasticsearch.core.mapping; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; @@ -31,6 +33,8 @@ import org.springframework.data.elasticsearch.annotations.Setting; import org.springframework.data.elasticsearch.core.index.Settings; import org.springframework.data.elasticsearch.core.join.JoinField; +import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.mapping.MappingException; import org.springframework.data.mapping.PropertyHandler; import org.springframework.data.mapping.model.BasicPersistentEntity; @@ -80,6 +84,7 @@ public class SimpleElasticsearchPersistentEntity extends BasicPersistentEntit private final ConcurrentHashMap routingExpressions = new ConcurrentHashMap<>(); private @Nullable String routing; private final ContextConfiguration contextConfiguration; + private final Set aliases = new HashSet<>(); private final ConcurrentHashMap indexNameExpressions = new ConcurrentHashMap<>(); private final Lazy indexNameEvaluationContext = Lazy.of(this::getIndexNameEvaluationContext); @@ -112,6 +117,7 @@ public SimpleElasticsearchPersistentEntity(TypeInformation typeInformation, this.dynamic = document.dynamic(); this.storeIdInSource = document.storeIdInSource(); this.storeVersionInSource = document.storeVersionInSource(); + buildAliases(); } else { this.dynamic = Dynamic.INHERIT; this.storeIdInSource = true; @@ -138,6 +144,11 @@ public IndexCoordinates getIndexCoordinates() { return resolve(IndexCoordinates.of(getIndexName())); } + @Override + public Set getAliases() { + return aliases; + } + @Nullable @Override public String getIndexStoreType() { @@ -615,4 +626,36 @@ public boolean getWriteTypeHints() { public Dynamic dynamic() { return dynamic; } + + /** + * Building once the aliases for the current document. + */ + private void buildAliases() { + // Clear the existing aliases. + aliases.clear(); + + if (document != null) { + for (org.springframework.data.elasticsearch.annotations.Alias alias : document.aliases()) { + if (alias.value().isEmpty()) { + continue; + } + + Query query = null; + if (!alias.filter().value().isEmpty()) { + query = new StringQuery(alias.filter().value()); + } + + aliases.add( + Alias.builder(alias.value()) + .withFilter(query) + .withIndexRouting(alias.indexRouting()) + .withSearchRouting(alias.searchRouting()) + .withRouting(alias.routing()) + .withHidden(alias.isHidden()) + .withWriteIndex(alias.isWriteIndex()) + .build() + ); + } + } + } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java index eb65d0ac9..d308eb8f0 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java @@ -16,11 +16,14 @@ package org.springframework.data.elasticsearch.core.index; import static org.assertj.core.api.Assertions.assertThat; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import org.assertj.core.api.InstanceOfAssertFactories; import org.assertj.core.api.SoftAssertions; import org.json.JSONException; import org.junit.jupiter.api.BeforeEach; @@ -30,13 +33,18 @@ import org.skyscreamer.jsonassert.JSONAssert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Alias; import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.Filter; import org.springframework.data.elasticsearch.annotations.Mapping; import org.springframework.data.elasticsearch.annotations.Setting; +import org.springframework.data.elasticsearch.client.elc.Queries; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.IndexInformation; import org.springframework.data.elasticsearch.core.IndexOperations; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; +import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.lang.Nullable; @@ -171,6 +179,29 @@ void shouldReturnAliasDataWithGetAliasesForIndexMethod() { softly.assertAll(); } + @Test + void shouldCreateIndexWithAliases() { + // Given + indexNameProvider.increment(); + String indexName = indexNameProvider.indexName(); + indexOperations = operations.indexOps(EntityWithAliases.class); + indexOperations.createWithMapping(); + + // When + Map> aliases = indexOperations.getAliasesForIndex(indexName); + + // Then + AliasData result = aliases.values().stream().findFirst().orElse(new HashSet<>()).stream().findFirst().orElse(null); + assertThat(result).isNotNull(); + assertThat(result.getAlias()).isEqualTo("first_alias"); + assertThat(result.getFilterQuery()).asInstanceOf(InstanceOfAssertFactories.type(StringQuery.class)) + .extracting(StringQuery::getSource) + .asString() + .contains(Queries.wrapperQuery(""" + {"bool" : {"must" : {"term" : {"type" : "abc"}}}} + """).query()); + } + @Document(indexName = "#{@indexNameProvider.indexName()}") @Setting(settingPath = "settings/test-settings.json") @Mapping(mappingPath = "mappings/test-mappings.json") @@ -186,4 +217,31 @@ public void setId(@Nullable String id) { this.id = id; } } + + @Document(indexName = "#{@indexNameProvider.indexName()}", aliases = { + @Alias(value = "first_alias", filter =@Filter(""" + {"bool" : {"must" : {"term" : {"type" : "abc"}}}} + """)) + }) + private static class EntityWithAliases { + @Nullable private @Id String id; + @Field(type = Text) private String type; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java index b37ba3c53..3a56d505c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java @@ -17,12 +17,19 @@ import static org.assertj.core.api.Assertions.*; import static org.skyscreamer.jsonassert.JSONAssert.*; +import static org.springframework.data.elasticsearch.annotations.FieldType.Text; import static org.springframework.data.elasticsearch.core.IndexOperationsAdapter.*; +import org.assertj.core.api.InstanceOfAssertFactories; +import org.springframework.data.elasticsearch.annotations.Alias; +import org.springframework.data.elasticsearch.annotations.Filter; +import org.springframework.data.elasticsearch.client.elc.Queries; +import org.springframework.data.elasticsearch.core.query.StringQuery; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import java.time.LocalDate; +import java.util.HashSet; import java.util.Set; import org.json.JSONException; @@ -346,6 +353,33 @@ void shouldGetAliasData() { .verifyComplete(); } + @Test + void shouldCreateIndexWithAliases() { + // Given + indexNameProvider.increment(); + String indexName = indexNameProvider.indexName(); + indexOperations = operations.indexOps(EntityWithAliases.class); + blocking(indexOperations).createWithMapping(); + + // When + + // Then + indexOperations.getAliasesForIndex(indexName) + .as(StepVerifier::create) + .assertNext(aliases -> { + AliasData result = aliases.values().stream().findFirst().orElse(new HashSet<>()).stream().findFirst().orElse(null); + + assertThat(result).isNotNull(); + assertThat(result.getAlias()).isEqualTo("first_alias"); + assertThat(result.getFilterQuery()).asInstanceOf(InstanceOfAssertFactories.type(StringQuery.class)) + .extracting(StringQuery::getSource) + .asString() + .contains(Queries.wrapperQuery(""" + {"bool" : {"must" : {"term" : {"type" : "abc"}}}} + """).query()); + }).verifyComplete(); + } + @Document(indexName = "#{@indexNameProvider.indexName()}") @Setting(shards = 3, replicas = 2, refreshInterval = "4s") static class Entity { @@ -401,4 +435,31 @@ public void setId(@Nullable String id) { this.id = id; } } + + @Document(indexName = "#{@indexNameProvider.indexName()}", aliases = { + @Alias(value = "first_alias", filter =@Filter(""" + {"bool" : {"must" : {"term" : {"type" : "abc"}}}} + """)) + }) + private static class EntityWithAliases { + @Nullable private @Id String id; + @Field(type = Text) private String type; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } } From 161439ae22a7698b8f353710d0599a8f0cc2af16 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 26 May 2024 20:31:42 +0200 Subject: [PATCH 013/131] Polishing --- .../data/elasticsearch/annotations/Alias.java | 75 ++-- .../elasticsearch/annotations/Aliases.java | 5 +- .../elasticsearch/annotations/Filter.java | 21 +- .../client/elc/IndicesTemplate.java | 9 +- .../client/elc/ReactiveIndicesTemplate.java | 6 +- .../client/elc/RequestConverter.java | 21 +- .../elasticsearch/core/mapping/Alias.java | 392 +++++++++--------- .../core/mapping/CreateIndexSettings.java | 129 +++--- .../ElasticsearchPersistentEntity.java | 8 +- .../SimpleElasticsearchPersistentEntity.java | 7 +- .../IndexOperationsIntegrationTests.java | 14 +- ...activeIndexOperationsIntegrationTests.java | 21 +- 12 files changed, 342 insertions(+), 366 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java index 0fd1e3694..4017507f3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java @@ -15,9 +15,6 @@ */ package org.springframework.data.elasticsearch.annotations; - -import org.springframework.core.annotation.AliasFor; - import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Repeatable; @@ -25,6 +22,8 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.core.annotation.AliasFor; + /** * Identifies an alias for the index. * @@ -33,48 +32,48 @@ */ @Inherited @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) +@Target({ ElementType.TYPE }) @Repeatable(Aliases.class) public @interface Alias { - /** - * @return Index alias name. Alias for {@link #alias}. - */ - @AliasFor("alias") - String value() default ""; + /** + * @return Index alias name. Alias for {@link #alias}. + */ + @AliasFor("alias") + String value() default ""; - /** - * @return Index alias name. Alias for {@link #value}. - */ - @AliasFor("value") - String alias() default ""; + /** + * @return Index alias name. Alias for {@link #value}. + */ + @AliasFor("value") + String alias() default ""; - /** - * @return Query used to limit documents the alias can access. - */ - Filter filter() default @Filter; + /** + * @return Query used to limit documents the alias can access. + */ + Filter filter() default @Filter; - /** - * @return Used to route indexing operations to a specific shard. - */ - String indexRouting() default ""; + /** + * @return Used to route indexing operations to a specific shard. + */ + String indexRouting() default ""; - /** - * @return Used to route indexing and search operations to a specific shard. - */ - String routing() default ""; + /** + * @return Used to route indexing and search operations to a specific shard. + */ + String routing() default ""; - /** - * @return Used to route search operations to a specific shard. - */ - String searchRouting() default ""; + /** + * @return Used to route search operations to a specific shard. + */ + String searchRouting() default ""; - /** - * @return Is the alias hidden? - */ - boolean isHidden() default false; + /** + * @return Is the alias hidden? + */ + boolean isHidden() default false; - /** - * @return Is it the 'write index' for the alias? - */ - boolean isWriteIndex() default false; + /** + * @return Is it the 'write index' for the alias? + */ + boolean isWriteIndex() default false; } diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java index b72108210..6db4fd896 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java @@ -15,7 +15,6 @@ */ package org.springframework.data.elasticsearch.annotations; - import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; @@ -31,7 +30,7 @@ */ @Inherited @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) +@Target({ ElementType.TYPE }) public @interface Aliases { - Alias[] value(); + Alias[] value(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java index 6d68e3813..73f23243e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java @@ -15,7 +15,6 @@ */ package org.springframework.data.elasticsearch.annotations; - import org.springframework.core.annotation.AliasFor; /** @@ -25,15 +24,15 @@ * @since 5.4 */ public @interface Filter { - /** - * @return Query used to limit documents. Alias for {@link #query}. - */ - @AliasFor("query") - String value() default ""; + /** + * @return Query used to limit documents. Alias for {@link #query}. + */ + @AliasFor("query") + String value() default ""; - /** - * @return Query used to limit documents. Alias for {@link #value}. - */ - @AliasFor("value") - String query() default ""; + /** + * @return Query used to limit documents. Alias for {@link #value}. + */ + @AliasFor("value") + String query() default ""; } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java index c5a2d029c..c46f1da0e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java @@ -27,8 +27,6 @@ import java.util.Objects; import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.UncategorizedElasticsearchException; @@ -63,8 +61,6 @@ public class IndicesTemplate extends ChildTemplate implements IndexOperations { - private static final Log LOGGER = LogFactory.getLog(IndicesTemplate.class); - // we need a cluster client as well because ES has put some methods from the indices API into the cluster client // (component templates) private final ClusterTemplate clusterTemplate; @@ -88,7 +84,7 @@ public IndicesTemplate(ElasticsearchIndicesClient client, ClusterTemplate cluste } public IndicesTemplate(ElasticsearchIndicesClient client, ClusterTemplate clusterTemplate, - ElasticsearchConverter elasticsearchConverter, IndexCoordinates boundIndex) { + ElasticsearchConverter elasticsearchConverter, IndexCoordinates boundIndex) { super(client, elasticsearchConverter); Assert.notNull(clusterTemplate, "cluster must not be null"); @@ -242,8 +238,7 @@ public Map getMapping() { GetMappingRequest getMappingRequest = requestConverter.indicesGetMappingRequest(indexCoordinates); GetMappingResponse getMappingResponse = execute(client -> client.getMapping(getMappingRequest)); - Document mappingResponse = responseConverter.indicesGetMapping(getMappingResponse, indexCoordinates); - return mappingResponse; + return responseConverter.indicesGetMapping(getMappingResponse, indexCoordinates); } @Override diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java index 1c90c7a83..d4c7a6e1b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java @@ -15,14 +15,12 @@ */ package org.springframework.data.elasticsearch.client.elc; -import static org.springframework.util.StringUtils.hasText; +import static org.springframework.util.StringUtils.*; import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; import co.elastic.clients.elasticsearch.indices.*; import co.elastic.clients.transport.ElasticsearchTransport; import co.elastic.clients.transport.endpoints.BooleanResponse; -import org.springframework.data.elasticsearch.core.mapping.Alias; -import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -49,6 +47,8 @@ import org.springframework.data.elasticsearch.core.index.GetTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutIndexTemplateRequest; import org.springframework.data.elasticsearch.core.index.PutTemplateRequest; +import org.springframework.data.elasticsearch.core.mapping.Alias; +import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.lang.Nullable; 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 aef836ad2..80efd4487 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 @@ -113,7 +113,6 @@ * @author Haibo Liu * @since 4.4 */ -@SuppressWarnings("ClassCanBeRecord") class RequestConverter extends AbstractQueryProcessor { private static final Log LOGGER = LogFactory.getLog(RequestConverter.class); @@ -172,7 +171,8 @@ public co.elastic.clients.elasticsearch.cluster.PutComponentTemplateRequest clus })); } - private co.elastic.clients.elasticsearch.indices.Alias.Builder buildAlias(AliasActionParameters parameters, co.elastic.clients.elasticsearch.indices.Alias.Builder aliasBuilder) { + private co.elastic.clients.elasticsearch.indices.Alias.Builder buildAlias(AliasActionParameters parameters, + co.elastic.clients.elasticsearch.indices.Alias.Builder aliasBuilder) { if (parameters.getRouting() != null) { aliasBuilder.routing(parameters.getRouting()); @@ -239,13 +239,13 @@ public ExistsRequest indicesExistsRequest(IndexCoordinates indexCoordinates) { public CreateIndexRequest indicesCreateRequest(CreateIndexSettings indexSettings) { Map aliases = new HashMap<>(); for (Alias alias : indexSettings.getAliases()) { - co.elastic.clients.elasticsearch.indices.Alias esAlias = co.elastic.clients.elasticsearch.indices.Alias.of(ab -> ab.filter(getQuery(alias.getFilter(), null)) - .routing(alias.getRouting()) - .indexRouting(alias.getIndexRouting()) - .searchRouting(alias.getSearchRouting()) - .isHidden(alias.getHidden()) - .isWriteIndex(alias.getWriteIndex()) - ); + co.elastic.clients.elasticsearch.indices.Alias esAlias = co.elastic.clients.elasticsearch.indices.Alias + .of(ab -> ab.filter(getQuery(alias.getFilter(), null)) + .routing(alias.getRouting()) + .indexRouting(alias.getIndexRouting()) + .searchRouting(alias.getSearchRouting()) + .isHidden(alias.getHidden()) + .isWriteIndex(alias.getWriteIndex())); aliases.put(alias.getAlias(), esAlias); } @@ -1026,7 +1026,7 @@ public DeleteByQueryRequest documentDeleteByQueryRequest(DeleteQuery query, @Nul order = sortField.order().jsonValue(); } - return sortField.field() + ":" + order; + return sortField.field() + ':' + order; }) .collect(Collectors.toList())); } @@ -1790,7 +1790,6 @@ co.elastic.clients.elasticsearch._types.query_dsl.Query getQuery(@Nullable Query return getEsQuery(query, (q) -> elasticsearchConverter.updateQuery(q, clazz)); } - @SuppressWarnings("StatementWithEmptyBody") private void addPostFilter(Query query, SearchRequest.Builder builder) { // we only need to handle NativeQuery here. filter from a CriteriaQuery are added into the query and not as post diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java index bbaa62443..97bbfe464 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java @@ -15,12 +15,12 @@ */ package org.springframework.data.elasticsearch.core.mapping; +import java.util.Objects; + import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.lang.Nullable; import org.springframework.util.Assert; -import java.util.Objects; - /** * Immutable Value object encapsulating index alias(es). * @@ -28,205 +28,191 @@ * @since 5.4 */ public class Alias { - /** - * Alias name for the index. - */ - private final String alias; - - /** - * Query used to limit documents the alias can access. - */ - @Nullable - private final Query filter; - - /** - * Used to route indexing operations to a specific shard. - */ - @Nullable - private final String indexRouting; - - /** - * Used to route search operations to a specific shard. - */ - @Nullable - private final String searchRouting; - - /** - * Used to route indexing and search operations to a specific shard. - */ - @Nullable - private final String routing; - - /** - * The alias is hidden? - * By default, this is set to {@code false}. - */ - @Nullable - private final Boolean isHidden; - - /** - * The index is the 'write index' for the alias? - * By default, this is set to {@code false}. - */ - @Nullable - private final Boolean isWriteIndex; - - private Alias(Builder builder) { - this.alias = builder.alias; - - this.filter = builder.filter; - - this.indexRouting = builder.indexRouting; - this.searchRouting = builder.searchRouting; - this.routing = builder.routing; - - this.isHidden = builder.isHidden; - this.isWriteIndex = builder.isWriteIndex; - } - - public String getAlias() { - return alias; - } - - @Nullable - public Query getFilter() { - return filter; - } - - @Nullable - public String getIndexRouting() { - return indexRouting; - } - - @Nullable - public String getSearchRouting() { - return searchRouting; - } - - @Nullable - public String getRouting() { - return routing; - } - - @Nullable - public Boolean getHidden() { - return isHidden; - } - - @Nullable - public Boolean getWriteIndex() { - return isWriteIndex; - } - - public static Builder builder(String alias) { - return new Builder(alias); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof Alias that)) return false; - - return Objects.equals(alias, that.alias) && Objects.equals(filter, that.filter) - && Objects.equals(indexRouting, that.indexRouting) - && Objects.equals(searchRouting, that.searchRouting) - && Objects.equals(routing, that.routing) - && Objects.equals(isHidden, that.isHidden) - && Objects.equals(isWriteIndex, that.isWriteIndex); - } - - @Override - public int hashCode() { - return Objects.hash(alias, filter, indexRouting, searchRouting, routing, isHidden, isWriteIndex); - } - - public static class Builder { - private final String alias; - - @Nullable - private Query filter; - - @Nullable - private String indexRouting; - @Nullable - private String searchRouting; - @Nullable - private String routing; - - @Nullable - private Boolean isHidden; - @Nullable - private Boolean isWriteIndex; - - public Builder(String alias) { - Assert.notNull(alias, "alias must not be null"); - this.alias = alias; - } - - /** - * Query used to limit documents the alias can access. - */ - public Builder withFilter(@Nullable Query filter) { - this.filter = filter; - - return this; - } - - /** - * Used to route indexing operations to a specific shard. - */ - public Builder withIndexRouting(@Nullable String indexRouting) { - if (indexRouting != null && !indexRouting.trim().isEmpty()) { - this.indexRouting = indexRouting; - } - - return this; - } - - /** - * Used to route search operations to a specific shard. - */ - public Builder withSearchRouting(@Nullable String searchRouting) { - if (searchRouting != null && !searchRouting.trim().isEmpty()) { - this.searchRouting = searchRouting; - } - - return this; - } - - /** - * Used to route indexing and search operations to a specific shard. - */ - public Builder withRouting(@Nullable String routing) { - if (routing != null && !routing.trim().isEmpty()) { - this.routing = routing; - } - - return this; - } - - /** - * The alias is hidden? - * By default, this is set to {@code false}. - */ - public Builder withHidden(@Nullable Boolean hidden) { - isHidden = hidden; - - return this; - } - - /** - * The index is the 'write index' for the alias? - * By default, this is set to {@code false}. - */ - public Builder withWriteIndex(@Nullable Boolean writeIndex) { - isWriteIndex = writeIndex; - - return this; - } - - public Alias build() { - return new Alias(this); - } - } + /** + * Alias name for the index. + */ + private final String alias; + + /** + * Query used to limit documents the alias can access. + */ + @Nullable private final Query filter; + + /** + * Used to route indexing operations to a specific shard. + */ + @Nullable private final String indexRouting; + + /** + * Used to route search operations to a specific shard. + */ + @Nullable private final String searchRouting; + + /** + * Used to route indexing and search operations to a specific shard. + */ + @Nullable private final String routing; + + /** + * The alias is hidden? By default, this is set to {@code false}. + */ + @Nullable private final Boolean isHidden; + + /** + * The index is the 'write index' for the alias? By default, this is set to {@code false}. + */ + @Nullable private final Boolean isWriteIndex; + + private Alias(Builder builder) { + this.alias = builder.alias; + + this.filter = builder.filter; + + this.indexRouting = builder.indexRouting; + this.searchRouting = builder.searchRouting; + this.routing = builder.routing; + + this.isHidden = builder.isHidden; + this.isWriteIndex = builder.isWriteIndex; + } + + public String getAlias() { + return alias; + } + + @Nullable + public Query getFilter() { + return filter; + } + + @Nullable + public String getIndexRouting() { + return indexRouting; + } + + @Nullable + public String getSearchRouting() { + return searchRouting; + } + + @Nullable + public String getRouting() { + return routing; + } + + @Nullable + public Boolean getHidden() { + return isHidden; + } + + @Nullable + public Boolean getWriteIndex() { + return isWriteIndex; + } + + public static Builder builder(String alias) { + return new Builder(alias); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof Alias that)) + return false; + + return Objects.equals(alias, that.alias) && Objects.equals(filter, that.filter) + && Objects.equals(indexRouting, that.indexRouting) + && Objects.equals(searchRouting, that.searchRouting) + && Objects.equals(routing, that.routing) + && Objects.equals(isHidden, that.isHidden) + && Objects.equals(isWriteIndex, that.isWriteIndex); + } + + @Override + public int hashCode() { + return Objects.hash(alias, filter, indexRouting, searchRouting, routing, isHidden, isWriteIndex); + } + + public static class Builder { + private final String alias; + + @Nullable private Query filter; + + @Nullable private String indexRouting; + @Nullable private String searchRouting; + @Nullable private String routing; + + @Nullable private Boolean isHidden; + @Nullable private Boolean isWriteIndex; + + public Builder(String alias) { + Assert.notNull(alias, "alias must not be null"); + this.alias = alias; + } + + /** + * Query used to limit documents the alias can access. + */ + public Builder withFilter(@Nullable Query filter) { + this.filter = filter; + + return this; + } + + /** + * Used to route indexing operations to a specific shard. + */ + public Builder withIndexRouting(@Nullable String indexRouting) { + if (indexRouting != null && !indexRouting.trim().isEmpty()) { + this.indexRouting = indexRouting; + } + + return this; + } + + /** + * Used to route search operations to a specific shard. + */ + public Builder withSearchRouting(@Nullable String searchRouting) { + if (searchRouting != null && !searchRouting.trim().isEmpty()) { + this.searchRouting = searchRouting; + } + + return this; + } + + /** + * Used to route indexing and search operations to a specific shard. + */ + public Builder withRouting(@Nullable String routing) { + if (routing != null && !routing.trim().isEmpty()) { + this.routing = routing; + } + + return this; + } + + /** + * The alias is hidden? By default, this is set to {@code false}. + */ + public Builder withHidden(@Nullable Boolean hidden) { + isHidden = hidden; + + return this; + } + + /** + * The index is the 'write index' for the alias? By default, this is set to {@code false}. + */ + public Builder withWriteIndex(@Nullable Boolean writeIndex) { + isWriteIndex = writeIndex; + + return this; + } + + public Alias build() { + return new Alias(this); + } + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java index 1406626dd..b36c82f2f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java @@ -15,14 +15,14 @@ */ package org.springframework.data.elasticsearch.core.mapping; -import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; -import org.springframework.util.Assert; - import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.springframework.data.elasticsearch.core.document.Document; +import org.springframework.lang.Nullable; +import org.springframework.util.Assert; + /** * Encapsulating index mapping fields, settings, and index alias(es). * @@ -30,88 +30,85 @@ * @since 5.3 */ public class CreateIndexSettings { - private final IndexCoordinates indexCoordinates; - private final Set aliases; + private final IndexCoordinates indexCoordinates; + private final Set aliases; - @Nullable - private final Map settings; + @Nullable private final Map settings; - @Nullable - private final Document mapping; + @Nullable private final Document mapping; - private CreateIndexSettings(Builder builder) { - this.indexCoordinates = builder.indexCoordinates; - this.aliases = builder.aliases; + private CreateIndexSettings(Builder builder) { + this.indexCoordinates = builder.indexCoordinates; + this.aliases = builder.aliases; - this.settings = builder.settings; - this.mapping = builder.mapping; - } + this.settings = builder.settings; + this.mapping = builder.mapping; + } - public static Builder builder(IndexCoordinates indexCoordinates) { - return new Builder(indexCoordinates); - } + public static Builder builder(IndexCoordinates indexCoordinates) { + return new Builder(indexCoordinates); + } - public IndexCoordinates getIndexCoordinates() { - return indexCoordinates; - } + public IndexCoordinates getIndexCoordinates() { + return indexCoordinates; + } - public Alias[] getAliases() { - return aliases.toArray(Alias[]::new); - } + public Alias[] getAliases() { + return aliases.toArray(Alias[]::new); + } - public Map getSettings() { - return settings; - } + @Nullable + public Map getSettings() { + return settings; + } - @Nullable - public Document getMapping() { - return mapping; - } + @Nullable + public Document getMapping() { + return mapping; + } - public static class Builder { - private IndexCoordinates indexCoordinates; - private final Set aliases = new HashSet<>(); + public static class Builder { + private final IndexCoordinates indexCoordinates; + private final Set aliases = new HashSet<>(); - @Nullable - private Map settings; + @Nullable private Map settings; - @Nullable - private Document mapping; + @Nullable private Document mapping; - public Builder(IndexCoordinates indexCoordinates) { - Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); - this.indexCoordinates = indexCoordinates; - } + public Builder(IndexCoordinates indexCoordinates) { + Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); + this.indexCoordinates = indexCoordinates; + } - public Builder withAlias(Alias alias) { - Assert.notNull(alias, "alias must not be null"); - this.aliases.add(alias); + public Builder withAlias(Alias alias) { + Assert.notNull(alias, "alias must not be null"); + this.aliases.add(alias); - return this; - } + return this; + } - public Builder withAliases(Set aliases) { - Assert.notNull(aliases, "aliases must not be null"); - this.aliases.addAll(aliases); + public Builder withAliases(Set aliases) { + Assert.notNull(aliases, "aliases must not be null"); + this.aliases.addAll(aliases); - return this; - } + return this; + } - public Builder withSettings(Map settings) { - Assert.notNull(settings, "settings must not be null"); - this.settings = settings; + public Builder withSettings(Map settings) { + Assert.notNull(settings, "settings must not be null"); + this.settings = settings; - return this; - } + return this; + } - public Builder withMapping(@Nullable Document mapping) { - this.mapping = mapping; + public Builder withMapping(@Nullable Document mapping) { + this.mapping = mapping; - return this; - } + return this; + } - public CreateIndexSettings build() { - return new CreateIndexSettings(this); - } - } + public CreateIndexSettings build() { + return new CreateIndexSettings(this); + } + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java index e9d3d0c7a..252376bed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java @@ -15,6 +15,8 @@ */ package org.springframework.data.elasticsearch.core.mapping; +import java.util.Set; + import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Dynamic; import org.springframework.data.elasticsearch.annotations.Field; @@ -25,8 +27,6 @@ import org.springframework.data.mapping.model.FieldNamingStrategy; import org.springframework.lang.Nullable; -import java.util.Set; - /** * ElasticsearchPersistentEntity * @@ -76,7 +76,7 @@ public interface ElasticsearchPersistentEntity extends PersistentEntity { - AliasData result = aliases.values().stream().findFirst().orElse(new HashSet<>()).stream().findFirst().orElse(null); + AliasData result = aliases.values().stream().findFirst().orElse(new HashSet<>()).stream().findFirst() + .orElse(null); assertThat(result).isNotNull(); assertThat(result.getAlias()).isEqualTo("first_alias"); @@ -375,8 +376,8 @@ void shouldCreateIndexWithAliases() { .extracting(StringQuery::getSource) .asString() .contains(Queries.wrapperQuery(""" - {"bool" : {"must" : {"term" : {"type" : "abc"}}}} - """).query()); + {"bool" : {"must" : {"term" : {"type" : "abc"}}}} + """).query()); }).verifyComplete(); } @@ -437,7 +438,7 @@ public void setId(@Nullable String id) { } @Document(indexName = "#{@indexNameProvider.indexName()}", aliases = { - @Alias(value = "first_alias", filter =@Filter(""" + @Alias(value = "first_alias", filter = @Filter(""" {"bool" : {"must" : {"term" : {"type" : "abc"}}}} """)) }) From 9d139299b291a95ad38575a07fc6ff08446d693c Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Mon, 27 May 2024 19:38:00 +0200 Subject: [PATCH 014/131] Add documentation for migration 5.3 to 5.4 --- src/main/antora/modules/ROOT/nav.adoc | 2 ++ .../migration-guides/migration-guide-5.3-5.4.adoc | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc diff --git a/src/main/antora/modules/ROOT/nav.adoc b/src/main/antora/modules/ROOT/nav.adoc index db6e1ca61..04b27c63b 100644 --- a/src/main/antora/modules/ROOT/nav.adoc +++ b/src/main/antora/modules/ROOT/nav.adoc @@ -9,6 +9,8 @@ *** xref:migration-guides/migration-guide-4.4-5.0.adoc[] *** xref:migration-guides/migration-guide-5.0-5.1.adoc[] *** xref:migration-guides/migration-guide-5.1-5.2.adoc[] +*** xref:migration-guides/migration-guide-5.2-5.3.adoc[] +*** xref:migration-guides/migration-guide-5.3-5.4.adoc[] * xref:elasticsearch.adoc[] diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc new file mode 100644 index 000000000..d9eddf030 --- /dev/null +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc @@ -0,0 +1,12 @@ +[[elasticsearch-migration-guide-5.3-5.4]] += Upgrading from 5.3.x to 5.4.x + +This section describes breaking changes from version 5.3.x to 5.4.x and how removed features can be replaced by new introduced features. + +[[elasticsearch-migration-guide-5.3-5.4.breaking-changes]] +== Breaking Changes + +[[elasticsearch-migration-guide-5.3-5.4.deprecations]] +== Deprecations + +=== Removals From 687b014e70fbceb168f772ace6e2a41dea70d160 Mon Sep 17 00:00:00 2001 From: puppylpg Date: Wed, 29 May 2024 02:52:47 +0800 Subject: [PATCH 015/131] Add knn search parameter and remove knn query. Original Pull Rrequest #2920 Closes #2919 --- .../migration-guide-5.3-5.4.adoc | 11 ++ .../data/elasticsearch/annotations/Field.java | 22 +++ .../annotations/FieldElementType.java | 26 +++ .../elasticsearch/annotations/InnerField.java | 22 +++ .../annotations/KnnAlgorithmType.java | 38 ++++ .../annotations/KnnIndexOptions.java | 40 ++++ .../annotations/KnnSimilarity.java | 38 ++++ .../elasticsearch/client/elc/NativeQuery.java | 13 +- .../client/elc/NativeQueryBuilder.java | 24 ++- .../client/elc/RequestConverter.java | 26 +-- .../core/index/MappingParameters.java | 66 ++++++- .../index/MappingBuilderIntegrationTests.java | 4 +- .../core/index/MappingBuilderUnitTests.java | 72 +++++++ .../knn/KnnSearchELCIntegrationTests.java | 44 +++++ .../knn/KnnSearchIntegrationTests.java | 179 ++++++++++++++++++ 15 files changed, 576 insertions(+), 49 deletions(-) create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc index d9eddf030..c5178ff75 100644 --- a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.3-5.4.adoc @@ -6,6 +6,17 @@ This section describes breaking changes from version 5.3.x to 5.4.x and how remo [[elasticsearch-migration-guide-5.3-5.4.breaking-changes]] == Breaking Changes +[[elasticsearch-migration-guide-5.3-5.4.breaking-changes.knn-search]] +=== knn search +The `withKnnQuery` method in `NativeQueryBuilder` has been replaced with `withKnnSearches` to build a `NativeQuery` with knn search. + +`KnnQuery` and `KnnSearch` are two different classes in elasticsearch java client and are used for different queries, with different parameters supported: + +- `KnnSearch`: is https://www.elastic.co/guide/en/elasticsearch/reference/8.13/search-search.html#search-api-knn[the top level `knn` query] in the elasticsearch request; +- `KnnQuery`: is https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-knn-query.html[the `knn` query inside `query` clause]; + +If `KnnQuery` is still preferable, please be sure to construct it inside `query` clause manually, by means of `withQuery(co.elastic.clients.elasticsearch._types.query_dsl.Query query)` clause in `NativeQueryBuilder`. + [[elasticsearch-migration-guide-5.3-5.4.deprecations]] == Deprecations diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index dd299a493..63f74716b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -37,6 +37,7 @@ * @author Brian Kimmig * @author Morgan Lutz * @author Sascha Woo + * @author Haibo Liu */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.METHOD }) @@ -195,6 +196,27 @@ */ int dims() default -1; + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + String elementType() default FieldElementType.DEFAULT; + + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + KnnSimilarity knnSimilarity() default KnnSimilarity.DEFAULT; + + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + KnnIndexOptions[] knnIndexOptions() default {}; + /** * Controls how Elasticsearch dynamically adds fields to the inner object within the document.
* To be used in combination with {@link FieldType#Object} or {@link FieldType#Nested} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java new file mode 100644 index 000000000..93247b735 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java @@ -0,0 +1,26 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + +/** + * @author Haibo Liu + * @since 5.4 + */ +public final class FieldElementType { + public final static String DEFAULT = ""; + public final static String FLOAT = "float"; + public final static String BYTE = "byte"; +} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java index ceb605411..35bccd968 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java @@ -29,6 +29,7 @@ * @author Aleksei Arsenev * @author Brian Kimmig * @author Morgan Lutz + * @author Haibo Liu */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) @@ -149,4 +150,25 @@ * @since 4.2 */ int dims() default -1; + + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + String elementType() default FieldElementType.DEFAULT; + + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + KnnSimilarity knnSimilarity() default KnnSimilarity.DEFAULT; + + /** + * to be used in combination with {@link FieldType#Dense_Vector} + * + * @since 5.4 + */ + KnnIndexOptions[] knnIndexOptions() default {}; } diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java new file mode 100644 index 000000000..1eae1188d --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java @@ -0,0 +1,38 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + +/** + * @author Haibo Liu + * @since 5.4 + */ +public enum KnnAlgorithmType { + HNSW("hnsw"), + INT8_HNSW("int8_hnsw"), + FLAT("flat"), + INT8_FLAT("int8_flat"), + DEFAULT(""); + + private final String type; + + KnnAlgorithmType(String type) { + this.type = type; + } + + public String getType() { + return type; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java new file mode 100644 index 000000000..48e27a45f --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java @@ -0,0 +1,40 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + +/** + * @author Haibo Liu + * @since 5.4 + */ +public @interface KnnIndexOptions { + + KnnAlgorithmType type() default KnnAlgorithmType.DEFAULT; + + /** + * Only applicable to {@link KnnAlgorithmType#HNSW} and {@link KnnAlgorithmType#INT8_HNSW} index types. + */ + int m() default -1; + + /** + * Only applicable to {@link KnnAlgorithmType#HNSW} and {@link KnnAlgorithmType#INT8_HNSW} index types. + */ + int efConstruction() default -1; + + /** + * Only applicable to {@link KnnAlgorithmType#INT8_HNSW} and {@link KnnAlgorithmType#INT8_FLAT} index types. + */ + float confidenceInterval() default -1F; +} diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java new file mode 100644 index 000000000..97a23aa35 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java @@ -0,0 +1,38 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + +/** + * @author Haibo Liu + * @since 5.4 + */ +public enum KnnSimilarity { + L2_NORM("l2_norm"), + DOT_PRODUCT("dot_product"), + COSINE("cosine"), + MAX_INNER_PRODUCT("max_inner_product"), + DEFAULT(""); + + private final String similarity; + + KnnSimilarity(String similarity) { + this.similarity = similarity; + } + + public String getSimilarity() { + return similarity; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java index f1b5fdc24..ee1978688 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java @@ -15,7 +15,6 @@ */ package org.springframework.data.elasticsearch.client.elc; -import co.elastic.clients.elasticsearch._types.KnnQuery; import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.SortOptions; import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; @@ -30,7 +29,6 @@ import java.util.Map; import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.data.elasticsearch.core.query.ScriptedField; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -40,6 +38,7 @@ * * @author Peter-Josef Meisch * @author Sascha Woo + * @author Haibo Liu * @since 4.4 */ public class NativeQuery extends BaseQuery { @@ -54,7 +53,6 @@ public class NativeQuery extends BaseQuery { private List sortOptions = Collections.emptyList(); private Map searchExtensions = Collections.emptyMap(); - @Nullable private KnnQuery knnQuery; @Nullable private List knnSearches = Collections.emptyList(); public NativeQuery(NativeQueryBuilder builder) { @@ -72,7 +70,6 @@ public NativeQuery(NativeQueryBuilder builder) { "Cannot add an NativeQuery in a NativeQuery"); } this.springDataQuery = builder.getSpringDataQuery(); - this.knnQuery = builder.getKnnQuery(); this.knnSearches = builder.getKnnSearches(); } @@ -124,14 +121,6 @@ public void setSpringDataQuery(@Nullable org.springframework.data.elasticsearch. this.springDataQuery = springDataQuery; } - /** - * @since 5.1 - */ - @Nullable - public KnnQuery getKnnQuery() { - return knnQuery; - } - /** * @since 5.3.1 */ diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java index 1956a75ea..6887963da 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java @@ -40,6 +40,7 @@ /** * @author Peter-Josef Meisch * @author Sascha Woo + * @author Haibo Liu * @since 4.4 */ public class NativeQueryBuilder extends BaseQueryBuilder { @@ -213,13 +214,30 @@ public NativeQueryBuilder withQuery(org.springframework.data.elasticsearch.core. } /** - * @since 5.1 + * @since 5.4 */ - public NativeQueryBuilder withKnnQuery(KnnQuery knnQuery) { - this.knnQuery = knnQuery; + public NativeQueryBuilder withKnnSearches(List knnSearches) { + this.knnSearches = knnSearches; return this; } + /** + * @since 5.4 + */ + public NativeQueryBuilder withKnnSearches(Function> fn) { + + Assert.notNull(fn, "fn must not be null"); + + return withKnnSearches(fn.apply(new KnnSearch.Builder()).build()); + } + + /** + * @since 5.4 + */ + public NativeQueryBuilder withKnnSearches(KnnSearch knnSearch) { + return withKnnSearches(List.of(knnSearch)); + } + public NativeQuery build() { Assert.isTrue(query == null || springDataQuery == null, "Cannot have both a native query and a Spring Data query"); return new NativeQuery(this); 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 80efd4487..09ad82c6f 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 @@ -1377,7 +1377,7 @@ public MsearchRequest searchMsearchRequest( private Function> msearchHeaderBuilder(Query query, IndexCoordinates index, @Nullable String routing) { return h -> { - var searchType = (query instanceof NativeQuery nativeQuery && nativeQuery.getKnnQuery() != null) ? null + var searchType = (query instanceof NativeQuery nativeQuery && !isEmpty(nativeQuery.getKnnSearches())) ? null : searchType(query.getSearchType()); h // @@ -1409,7 +1409,7 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu ElasticsearchPersistentEntity persistentEntity = getPersistentEntity(clazz); - var searchType = (query instanceof NativeQuery nativeQuery && nativeQuery.getKnnQuery() != null) ? null + var searchType = (query instanceof NativeQuery nativeQuery && !isEmpty(nativeQuery.getKnnSearches())) ? null : searchType(query.getSearchType()); builder // @@ -1728,17 +1728,6 @@ private void prepareNativeSearch(NativeQuery query, SearchRequest.Builder builde .sort(query.getSortOptions()) // ; - if (query.getKnnQuery() != null) { - var kq = query.getKnnQuery(); - builder.knn(ksb -> ksb - .field(kq.field()) - .queryVector(kq.queryVector()) - .numCandidates(kq.numCandidates()) - .filter(kq.filter()) - .similarity(kq.similarity())); - - } - if (!isEmpty(query.getKnnSearches())) { builder.knn(query.getKnnSearches()); } @@ -1760,17 +1749,6 @@ private void prepareNativeSearch(NativeQuery query, MultisearchBody.Builder buil .collapse(query.getFieldCollapse()) // .sort(query.getSortOptions()); - if (query.getKnnQuery() != null) { - var kq = query.getKnnQuery(); - builder.knn(ksb -> ksb - .field(kq.field()) - .queryVector(kq.queryVector()) - .numCandidates(kq.numCandidates()) - .filter(kq.filter()) - .similarity(kq.similarity())); - - } - if (!isEmpty(query.getKnnSearches())) { builder.knn(query.getKnnSearches()); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java index 595cc6bd6..cd3903376 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java @@ -23,15 +23,7 @@ import java.util.List; import java.util.stream.Collectors; -import org.springframework.data.elasticsearch.annotations.DateFormat; -import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.data.elasticsearch.annotations.IndexOptions; -import org.springframework.data.elasticsearch.annotations.IndexPrefixes; -import org.springframework.data.elasticsearch.annotations.InnerField; -import org.springframework.data.elasticsearch.annotations.NullValueType; -import org.springframework.data.elasticsearch.annotations.Similarity; -import org.springframework.data.elasticsearch.annotations.TermVector; +import org.springframework.data.elasticsearch.annotations.*; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -49,6 +41,7 @@ * @author Brian Kimmig * @author Morgan Lutz * @author Sascha Woo + * @author Haibo Liu * @since 4.0 */ public final class MappingParameters { @@ -78,6 +71,10 @@ public final class MappingParameters { static final String FIELD_PARAM_ORIENTATION = "orientation"; static final String FIELD_PARAM_POSITIVE_SCORE_IMPACT = "positive_score_impact"; static final String FIELD_PARAM_DIMS = "dims"; + static final String FIELD_PARAM_ELEMENT_TYPE = "element_type"; + static final String FIELD_PARAM_M = "m"; + static final String FIELD_PARAM_EF_CONSTRUCTION = "ef_construction"; + static final String FIELD_PARAM_CONFIDENCE_INTERVAL = "confidence_interval"; static final String FIELD_PARAM_SCALING_FACTOR = "scaling_factor"; static final String FIELD_PARAM_SEARCH_ANALYZER = "search_analyzer"; static final String FIELD_PARAM_STORE = "store"; @@ -110,6 +107,9 @@ public final class MappingParameters { private final Integer positionIncrementGap; private final boolean positiveScoreImpact; private final Integer dims; + private final String elementType; + private final KnnSimilarity knnSimilarity; + @Nullable private final KnnIndexOptions knnIndexOptions; private final String searchAnalyzer; private final double scalingFactor; private final String similarity; @@ -174,6 +174,9 @@ private MappingParameters(Field field) { Assert.isTrue(dims >= 1 && dims <= 4096, "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096."); } + elementType = field.elementType(); + knnSimilarity = field.knnSimilarity(); + knnIndexOptions = field.knnIndexOptions().length > 0 ? field.knnIndexOptions()[0] : null; Assert.isTrue(field.enabled() || type == FieldType.Object, "enabled false is only allowed for field type object"); enabled = field.enabled(); eagerGlobalOrdinals = field.eagerGlobalOrdinals(); @@ -217,6 +220,9 @@ private MappingParameters(InnerField field) { Assert.isTrue(dims >= 1 && dims <= 4096, "Invalid required parameter! Dense_Vector value \"dims\" must be between 1 and 4096."); } + elementType = field.elementType(); + knnSimilarity = field.knnSimilarity(); + knnIndexOptions = field.knnIndexOptions().length > 0 ? field.knnIndexOptions()[0] : null; enabled = true; eagerGlobalOrdinals = field.eagerGlobalOrdinals(); } @@ -356,6 +362,48 @@ public void writeTypeAndParametersTo(ObjectNode objectNode) throws IOException { if (type == FieldType.Dense_Vector) { objectNode.put(FIELD_PARAM_DIMS, dims); + + if (!FieldElementType.DEFAULT.equals(elementType)) { + objectNode.put(FIELD_PARAM_ELEMENT_TYPE, elementType); + } + + if (knnSimilarity != KnnSimilarity.DEFAULT) { + objectNode.put(FIELD_PARAM_SIMILARITY, knnSimilarity.getSimilarity()); + } + + if (knnSimilarity != KnnSimilarity.DEFAULT) { + Assert.isTrue(index, "knn similarity can only be specified when 'index' is true."); + objectNode.put(FIELD_PARAM_SIMILARITY, knnSimilarity.getSimilarity()); + } + + if (knnIndexOptions != null) { + Assert.isTrue(index, "knn index options can only be specified when 'index' is true."); + ObjectNode indexOptionsNode = objectNode.putObject(FIELD_PARAM_INDEX_OPTIONS); + KnnAlgorithmType algoType = knnIndexOptions.type(); + if (algoType != KnnAlgorithmType.DEFAULT) { + if (algoType == KnnAlgorithmType.INT8_HNSW || algoType == KnnAlgorithmType.INT8_FLAT) { + Assert.isTrue(!FieldElementType.BYTE.equals(elementType), + "'element_type' can only be float when using vector quantization."); + } + indexOptionsNode.put(FIELD_PARAM_TYPE, algoType.getType()); + } + if (knnIndexOptions.m() >= 0) { + Assert.isTrue(algoType == KnnAlgorithmType.HNSW || algoType == KnnAlgorithmType.INT8_HNSW, + "knn 'm' parameter can only be applicable to hnsw and int8_hnsw index types."); + indexOptionsNode.put(FIELD_PARAM_M, knnIndexOptions.m()); + } + if (knnIndexOptions.efConstruction() >= 0) { + Assert.isTrue(algoType == KnnAlgorithmType.HNSW || algoType == KnnAlgorithmType.INT8_HNSW, + "knn 'ef_construction' can only be applicable to hnsw and int8_hnsw index types."); + indexOptionsNode.put(FIELD_PARAM_EF_CONSTRUCTION, knnIndexOptions.efConstruction()); + } + if (knnIndexOptions.confidenceInterval() >= 0) { + Assert.isTrue(algoType == KnnAlgorithmType.INT8_HNSW + || algoType == KnnAlgorithmType.INT8_FLAT, + "knn 'confidence_interval' can only be applicable to int8_hnsw and int8_flat index types."); + indexOptionsNode.put(FIELD_PARAM_CONFIDENCE_INTERVAL, knnIndexOptions.confidenceInterval()); + } + } } if (!enabled) { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index f769ffaaa..1d37f007a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -58,6 +58,7 @@ * @author Roman Puchkovskiy * @author Brian Kimmig * @author Morgan Lutz + * @author Haibo Liu */ @SpringIntegrationTest public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests { @@ -908,7 +909,8 @@ static class SimilarityEntity { @Nullable @Id private String id; - @Field(type = FieldType.Dense_Vector, dims = 42, similarity = "cosine") private double[] denseVector; + @Field(type = FieldType.Dense_Vector, dims = 42, knnSimilarity = KnnSimilarity.COSINE) + private double[] denseVector; } @Mapping(aliases = { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index 8ce062c28..cf5ac6f3b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -62,6 +62,7 @@ * @author Roman Puchkovskiy * @author Brian Kimmig * @author Morgan Lutz + * @author Haibo Liu */ public class MappingBuilderUnitTests extends MappingContextBaseTests { @@ -695,6 +696,32 @@ void shouldWriteDenseVectorProperties() throws JSONException { assertEquals(expected, mapping, false); } + @Test + @DisplayName("should write dense_vector properties for knn search") + void shouldWriteDenseVectorPropertiesWithKnnSearch() throws JSONException { + String expected = """ + { + "properties":{ + "my_vector":{ + "type":"dense_vector", + "dims":16, + "element_type":"float", + "similarity":"dot_product", + "index_options":{ + "type":"hnsw", + "m":16, + "ef_construction":100 + } + } + } + } + """; + + String mapping = getMappingBuilder().buildPropertyMapping(DenseVectorEntityWithKnnSearch.class); + + assertEquals(expected, mapping, false); + } + @Test // #1370 @DisplayName("should not write mapping when enabled is false on entity") void shouldNotWriteMappingWhenEnabledIsFalseOnEntity() throws JSONException { @@ -741,6 +768,14 @@ void shouldOnlyAllowDisabledPropertiesOnTypeObject() { .isInstanceOf(MappingException.class); } + @Test + @DisplayName("should match confidence interval parameter for dense_vector type") + void shouldMatchConfidenceIntervalParameterForDenseVectorType() { + + assertThatThrownBy(() -> getMappingBuilder().buildPropertyMapping(DenseVectorMisMatchConfidenceIntervalClass.class)) + .isInstanceOf(IllegalArgumentException.class); + } + @Test // #1711 @DisplayName("should write typeHint entries") void shouldWriteTypeHintEntries() throws JSONException { @@ -2063,6 +2098,36 @@ public void setMy_vector(@Nullable float[] my_vector) { } } + @SuppressWarnings("unused") + static class DenseVectorEntityWithKnnSearch { + @Nullable + @Id private String id; + + @Nullable + @Field(type = FieldType.Dense_Vector, dims = 16, elementType = FieldElementType.FLOAT, + knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, efConstruction = 100), + knnSimilarity = KnnSimilarity.DOT_PRODUCT) + private float[] my_vector; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public float[] getMy_vector() { + return my_vector; + } + + public void setMy_vector(@Nullable float[] my_vector) { + this.my_vector = my_vector; + } + } + @Mapping(enabled = false) static class DisabledMappingEntity { @Nullable @@ -2115,6 +2180,13 @@ public void setText(@Nullable String text) { } } + static class DenseVectorMisMatchConfidenceIntervalClass { + @Field(type = Dense_Vector, dims = 16, elementType = FieldElementType.FLOAT, + knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, confidenceInterval = 0.95F), + knnSimilarity = KnnSimilarity.DOT_PRODUCT) + private float[] dense_vector; + } + static class DisabledMappingProperty { @Nullable @Id private String id; diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java new file mode 100644 index 000000000..6edc3044d --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repositories.knn; + +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.data.elasticsearch.repository.config.EnableElasticsearchRepositories; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.test.context.ContextConfiguration; + +/** + * @author Haibo Liu + * @since 5.4 + */ +@ContextConfiguration(classes = { KnnSearchELCIntegrationTests.Config.class }) +public class KnnSearchELCIntegrationTests extends KnnSearchIntegrationTests { + + @Configuration + @Import({ ElasticsearchTemplateConfiguration.class }) + @EnableElasticsearchRepositories( + basePackages = { "org.springframework.data.elasticsearch.repositories.knn" }, + considerNestedRepositories = true) + static class Config { + @Bean + IndexNameProvider indexNameProvider() { + return new IndexNameProvider("knn-repository"); + } + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java new file mode 100644 index 000000000..1def46cd8 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -0,0 +1,179 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repositories.knn; + +import static org.assertj.core.api.Assertions.*; +import static org.springframework.data.elasticsearch.annotations.FieldType.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.annotation.Id; +import org.springframework.data.domain.Pageable; +import org.springframework.data.elasticsearch.annotations.*; +import org.springframework.data.elasticsearch.client.elc.NativeQuery; +import org.springframework.data.elasticsearch.client.elc.NativeQueryBuilder; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.SearchHit; +import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; +import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.lang.Nullable; + +/** + * @author Haibo Liu + * @since 5.4 + */ +@SpringIntegrationTest +public abstract class KnnSearchIntegrationTests { + + @Autowired ElasticsearchOperations operations; + @Autowired private IndexNameProvider indexNameProvider; + @Autowired private VectorEntityRepository vectorEntityRepository; + + @BeforeEach + public void before() { + indexNameProvider.increment(); + operations.indexOps(VectorEntity.class).createWithMapping(); + } + + @Test + @org.junit.jupiter.api.Order(java.lang.Integer.MAX_VALUE) + void cleanup() { + operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete(); + } + + private List createVectorEntities(int n) { + List entities = new ArrayList<>(); + float increment = 1.0f / n; + for (int i = 0; i < n; i++) { + VectorEntity entity = new VectorEntity(); + entity.setId(UUID.randomUUID().toString()); + entity.setMessage("top" + (i + 1)); + + // The generated vector is always in the first quadrant, from the x-axis direction to the y-axis direction + float[] vector = new float[] {1.0f - i * increment, increment}; + entity.setVector(vector); + entities.add(entity); + } + + return entities; + } + + @Test + public void shouldReturnXAxisVector() { + + // given + List entities = createVectorEntities(5); + vectorEntityRepository.saveAll(entities); + List xAxisVector = List.of(100f, 0f); + + // when + NativeQuery query = new NativeQueryBuilder() + .withKnnSearches(ksb -> ksb.queryVector(xAxisVector).k(3L).field("vector")) + .withPageable(Pageable.ofSize(2)) + .build(); + SearchHits result = operations.search(query, VectorEntity.class); + + List vectorEntities = result.getSearchHits().stream().map(SearchHit::getContent).toList(); + + // then + assertThat(result).isNotNull(); + assertThat(result.getTotalHits()).isEqualTo(3L); + // should return the first vector, because it's near x-axis + assertThat(vectorEntities.get(0).getMessage()).isEqualTo("top1"); + } + + @Test + public void shouldReturnYAxisVector() { + + // given + List entities = createVectorEntities(10); + vectorEntityRepository.saveAll(entities); + List yAxisVector = List.of(0f, 100f); + + // when + NativeQuery query = new NativeQueryBuilder() + .withKnnSearches(ksb -> ksb.queryVector(yAxisVector).k(3L).field("vector")) + .withPageable(Pageable.ofSize(2)) + .build(); + SearchHits result = operations.search(query, VectorEntity.class); + + List vectorEntities = result.getSearchHits().stream().map(SearchHit::getContent).toList(); + + // then + assertThat(result).isNotNull(); + assertThat(result.getTotalHits()).isEqualTo(3L); + // should return the last vector, because it's near y-axis + assertThat(vectorEntities.get(0).getMessage()).isEqualTo("top10"); + } + + public interface VectorEntityRepository extends ElasticsearchRepository { + } + + @Document(indexName = "#{@indexNameProvider.indexName()}") + static class VectorEntity { + @Nullable + @Id + private String id; + + @Nullable + @Field(type = Keyword) + private String message; + + // TODO: `elementType = FieldElementType.FLOAT,` is to be added here later + // TODO: element_type can not be set here, because it's left out in elasticsearch-specification + // TODO: the issue is fixed in https://github.com/elastic/elasticsearch-java/pull/800, but still not released in 8.13.x + // TODO: will be fixed later by either upgrading to 8.14.0 or a newer 8.13.x + @Field(type = FieldType.Dense_Vector, dims = 2, + knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, efConstruction = 100), + knnSimilarity = KnnSimilarity.COSINE) + private float[] vector; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public String getMessage() { + return message; + } + + public void setMessage(@Nullable String message) { + this.message = message; + } + + @Nullable + public float[] getVector() { + return vector; + } + + public void setVector(@Nullable float[] vector) { + this.vector = vector; + } + } +} From fade919be643b59e46cd9de9c2286f557994436b Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 28 May 2024 20:57:27 +0200 Subject: [PATCH 016/131] Polishing. --- .../index/MappingBuilderIntegrationTests.java | 3 +-- .../knn/KnnSearchIntegrationTests.java | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index 1d37f007a..e4bf6e48d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -909,8 +909,7 @@ static class SimilarityEntity { @Nullable @Id private String id; - @Field(type = FieldType.Dense_Vector, dims = 42, knnSimilarity = KnnSimilarity.COSINE) - private double[] denseVector; + @Field(type = FieldType.Dense_Vector, dims = 42, knnSimilarity = KnnSimilarity.COSINE) private double[] denseVector; } @Mapping(aliases = { diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java index 1def46cd8..e780e24aa 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -27,7 +27,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; import org.springframework.data.domain.Pageable; -import org.springframework.data.elasticsearch.annotations.*; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.KnnAlgorithmType; +import org.springframework.data.elasticsearch.annotations.KnnIndexOptions; +import org.springframework.data.elasticsearch.annotations.KnnSimilarity; import org.springframework.data.elasticsearch.client.elc.NativeQuery; import org.springframework.data.elasticsearch.client.elc.NativeQueryBuilder; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; @@ -71,7 +76,7 @@ private List createVectorEntities(int n) { entity.setMessage("top" + (i + 1)); // The generated vector is always in the first quadrant, from the x-axis direction to the y-axis direction - float[] vector = new float[] {1.0f - i * increment, increment}; + float[] vector = new float[] { 1.0f - i * increment, increment }; entity.setVector(vector); entities.add(entity); } @@ -127,27 +132,24 @@ public void shouldReturnYAxisVector() { assertThat(vectorEntities.get(0).getMessage()).isEqualTo("top10"); } - public interface VectorEntityRepository extends ElasticsearchRepository { - } + public interface VectorEntityRepository extends ElasticsearchRepository {} @Document(indexName = "#{@indexNameProvider.indexName()}") static class VectorEntity { @Nullable - @Id - private String id; + @Id private String id; @Nullable - @Field(type = Keyword) - private String message; + @Field(type = Keyword) private String message; // TODO: `elementType = FieldElementType.FLOAT,` is to be added here later // TODO: element_type can not be set here, because it's left out in elasticsearch-specification - // TODO: the issue is fixed in https://github.com/elastic/elasticsearch-java/pull/800, but still not released in 8.13.x + // TODO: the issue is fixed in https://github.com/elastic/elasticsearch-java/pull/800, but still not released in + // 8.13.x // TODO: will be fixed later by either upgrading to 8.14.0 or a newer 8.13.x @Field(type = FieldType.Dense_Vector, dims = 2, knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, efConstruction = 100), - knnSimilarity = KnnSimilarity.COSINE) - private float[] vector; + knnSimilarity = KnnSimilarity.COSINE) private float[] vector; @Nullable public String getId() { From 4ef5af1f2d8d5d7e1041194d05aaffcc2c0f6715 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 1 Jun 2024 15:26:45 +0200 Subject: [PATCH 017/131] Update dependencies. Original Pull Request #2923 Closes #2922 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index f3098645c..bfcde51b1 100644 --- a/pom.xml +++ b/pom.xml @@ -23,12 +23,12 @@ 8.13.4 - 1.0.8.RELEASE - 0.14.4 - 2.18.0 + 1.0.9.RELEASE + 0.18.1 + 2.23.1 1.5.1 - 1.18.0 - 2.35.1 + 1.19.8 + 3.0.1 spring.data.elasticsearch From d101eebc6d13e69df54bd5ad78fe533ac56a2d0a Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 11 Jun 2024 21:24:57 +0200 Subject: [PATCH 018/131] Upgrade to Elasticsearch-8.14.0. Original Pull Request #2926 Closes #2924 --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- .../antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- .../data/elasticsearch/client/elc/RequestConverter.java | 2 +- .../repositories/knn/KnnSearchIntegrationTests.java | 4 ++-- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index bfcde51b1..bfa17ce2c 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.13.4 + 8.14.0 1.0.9.RELEASE 0.18.1 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 16a297531..85f627e7e 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-4-0]] == New in Spring Data Elasticsearch 5.4 -* Upgrade to Elasticsearch 8.13.4. +* Upgrade to Elasticsearch 8.14.0. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 1a6dd4e52..394dc14de 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 -| 2024.1 (in development) | 5.3.x | 8.13.4 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.14.0 | 6.1.x | 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.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 09ad82c6f..614f958cf 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 @@ -409,7 +409,7 @@ public co.elastic.clients.elasticsearch.indices.PutTemplateRequest indicesPutTem if (putTemplateRequest.getSettings() != null) { Map settings = getTemplateParams(putTemplateRequest.getSettings().entrySet()); - builder.settings(settings); + builder.settings(sb -> sb.otherSettings(settings)); } if (putTemplateRequest.getMappings() != null) { diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java index e780e24aa..b8bd86985 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -94,7 +94,7 @@ public void shouldReturnXAxisVector() { // when NativeQuery query = new NativeQueryBuilder() - .withKnnSearches(ksb -> ksb.queryVector(xAxisVector).k(3L).field("vector")) + .withKnnSearches(ksb -> ksb.queryVector(xAxisVector).k(3).field("vector")) .withPageable(Pageable.ofSize(2)) .build(); SearchHits result = operations.search(query, VectorEntity.class); @@ -118,7 +118,7 @@ public void shouldReturnYAxisVector() { // when NativeQuery query = new NativeQueryBuilder() - .withKnnSearches(ksb -> ksb.queryVector(yAxisVector).k(3L).field("vector")) + .withKnnSearches(ksb -> ksb.queryVector(yAxisVector).k(3).field("vector")) .withPageable(Pageable.ofSize(2)) .build(); SearchHits result = operations.search(query, VectorEntity.class); diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 669b532c0..73447d3f3 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.13.4 +sde.testcontainers.image-version=8.14.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 From d9d1b73dad390ceefcffce745cbeec63ecccf2c0 Mon Sep 17 00:00:00 2001 From: puppylpg Date: Thu, 13 Jun 2024 00:27:43 +0800 Subject: [PATCH 019/131] Fix missing element_type when using elasticsearch-java 8.14.x Original Pull Request #2928 Closes #2927 --- .../repositories/knn/KnnSearchIntegrationTests.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java index b8bd86985..e886c8d5f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -29,6 +29,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldElementType; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.KnnAlgorithmType; import org.springframework.data.elasticsearch.annotations.KnnIndexOptions; @@ -142,12 +143,7 @@ static class VectorEntity { @Nullable @Field(type = Keyword) private String message; - // TODO: `elementType = FieldElementType.FLOAT,` is to be added here later - // TODO: element_type can not be set here, because it's left out in elasticsearch-specification - // TODO: the issue is fixed in https://github.com/elastic/elasticsearch-java/pull/800, but still not released in - // 8.13.x - // TODO: will be fixed later by either upgrading to 8.14.0 or a newer 8.13.x - @Field(type = FieldType.Dense_Vector, dims = 2, + @Field(type = FieldType.Dense_Vector, dims = 2, elementType = FieldElementType.FLOAT, knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, efConstruction = 100), knnSimilarity = KnnSimilarity.COSINE) private float[] vector; From eca6a7ec7734b2d39c59319492ce9a2199ca8e9e Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 13 Jun 2024 23:34:55 +0200 Subject: [PATCH 020/131] Upgrade to Elasticsearch-8.14.1. Original Pull Request #2930 Closes #2929 --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index bfa17ce2c..6589f3313 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.14.0 + 8.14.1 1.0.9.RELEASE 0.18.1 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 85f627e7e..8e1affb75 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-4-0]] == New in Spring Data Elasticsearch 5.4 -* Upgrade to Elasticsearch 8.14.0. +* Upgrade to Elasticsearch 8.14.1. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 394dc14de..58c39e57b 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 -| 2024.1 (in development) | 5.3.x | 8.14.0 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.14.1 | 6.1.x | 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 73447d3f3..218d70081 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.14.0 +sde.testcontainers.image-version=8.14.1 # # # 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 From 4cc80abcd85f8a9d360bf0c2ae89c7f5b0d4eae4 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 20 Jun 2024 11:18:11 +0200 Subject: [PATCH 021/131] Switch to Broadcom docker proxy. Closes #2934 --- Jenkinsfile | 44 ++++++++++++++++++++++++------------------ ci/pipeline.properties | 7 +++++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ade2e5a10..b75f12236 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,9 +39,11 @@ pipeline { steps { script { - docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) { - sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh" - sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh" + docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { + docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) { + sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh" + sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh" + } } } } @@ -68,9 +70,11 @@ pipeline { } steps { script { - docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) { - sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh" - sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh" + docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { + docker.image(p['docker.java.next.image']).inside(p['docker.java.inside.docker']) { + sh "PROFILE=none JENKINS_USER_NAME=${p['jenkins.user.name']} ci/verify.sh" + sh "JENKINS_USER_NAME=${p['jenkins.user.name']} ci/clean.sh" + } } } } @@ -97,19 +101,21 @@ pipeline { } steps { script { - docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { - sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + - "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + - "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + - "./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " + - "-Dartifactory.server=${p['artifactory.url']} " + - "-Dartifactory.username=${ARTIFACTORY_USR} " + - "-Dartifactory.password=${ARTIFACTORY_PSW} " + - "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " + - "-Dartifactory.build-name=spring-data-elasticsearch " + - "-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " + - "-Dmaven.test.skip=true clean deploy -U -B" + docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { + docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + + "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + + "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + + "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + + "./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " + + "-Dartifactory.server=${p['artifactory.url']} " + + "-Dartifactory.username=${ARTIFACTORY_USR} " + + "-Dartifactory.password=${ARTIFACTORY_PSW} " + + "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " + + "-Dartifactory.build-name=spring-data-elasticsearch " + + "-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " + + "-Dmaven.test.skip=true clean deploy -U -B" + } } } } diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 60057f265..824563a21 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -3,8 +3,8 @@ java.main.tag=17.0.9_9-jdk-focal java.next.tag=21.0.1_12-jdk-jammy # Docker container images - standard -docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag} -docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.next.tag} +docker.java.main.image=library/eclipse-temurin:${java.main.tag} +docker.java.next.image=library/eclipse-temurin:${java.next.tag} # Supported versions of MongoDB docker.mongodb.4.4.version=4.4.25 @@ -14,6 +14,7 @@ docker.mongodb.7.0.version=7.0.2 # Supported versions of Redis docker.redis.6.version=6.2.13 +docker.redis.7.version=7.2.4 # Supported versions of Cassandra docker.cassandra.3.version=3.11.16 @@ -25,6 +26,8 @@ docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock - # Credentials docker.registry= docker.credentials=hub.docker.com-springbuildmaster +docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com +docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c artifactory.url=https://repo.spring.io artifactory.repository.snapshot=libs-snapshot-local From 8d0ecf2aa38526412d3aa9e464d3cdbf857f0c71 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 4 Jul 2024 20:58:41 +0200 Subject: [PATCH 022/131] Update migration-guide-5.2-5.3.adoc --- .../pages/migration-guides/migration-guide-5.2-5.3.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.2-5.3.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.2-5.3.adoc index 17ab9063c..808578cb5 100644 --- a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.2-5.3.adoc +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.2-5.3.adoc @@ -6,10 +6,16 @@ This section describes breaking changes from version 5.2.x to 5.3.x and how remo [[elasticsearch-migration-guide-5.2-5.3.breaking-changes]] == Breaking Changes +During the parameter replacement in `@Query` annotated repository methods previous versions wrote the String `"null"` into the query that was sent to Elasticsearch when the actual parameter value was `null`. +As Elasticsearch does not store `null` values, this behaviour could lead to problems, for example whent the fields to be searched contains the string `"null"`. +In Version 5.3 a `null` value in a parameter will cause a `ConversionException` to be thrown. +If you are using `"null"` as the +`null_value` defined in a field mapping, then pass that string into the query instead of a Java `null`. [[elasticsearch-migration-guide-5.2-5.3.deprecations]] == Deprecations === Removals + The deprecated classes `org.springframework.data.elasticsearch.ELCQueries` - and `org.springframework.data.elasticsearch.client.elc.QueryBuilders` have been removed, use `org.springframework.data.elasticsearch.client.elc.Queries` instead. +and `org.springframework.data.elasticsearch.client.elc.QueryBuilders` have been removed, use `org.springframework.data.elasticsearch.client.elc.Queries` instead. From dd156b9e29650f80c3aad91a6632734b7159b029 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 6 Jul 2024 09:08:27 +0200 Subject: [PATCH 023/131] Enable use of search_after with field_collapse. Original Pull Request #2937 Closes #2935 --- .../elc/ReactiveElasticsearchTemplate.java | 23 +++++++++++- .../client/elc/RequestConverter.java | 14 +++++-- ...icsearchRepositoryELCIntegrationTests.java | 37 +++++++++++++++++++ 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index 12f1a59ee..5f4fd0360 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -395,7 +395,28 @@ private Flux doFindUnbounded(Query query, Class clazz, IndexC Function>> resourceClosure = psa -> { baseQuery.setPointInTime(new Query.PointInTime(psa.getPit(), pitKeepAlive)); - baseQuery.addSort(Sort.by("_shard_doc")); + + // only add _shard_doc if there is not a field_collapse and a sort with the same name + boolean addShardDoc = true; + + if (query instanceof NativeQuery nativeQuery && nativeQuery.getFieldCollapse() != null) { + var field = nativeQuery.getFieldCollapse().field(); + + if (nativeQuery.getSortOptions().stream() + .anyMatch(sortOptions -> sortOptions.isField() && sortOptions.field().field().equals(field))) { + addShardDoc = false; + } + + if (query.getSort() != null + && query.getSort().stream().anyMatch(order -> order.getProperty().equals(field))) { + addShardDoc = false; + } + } + + if (addShardDoc) { + baseQuery.addSort(Sort.by("_shard_doc")); + } + SearchRequest firstSearchRequest = requestConverter.searchRequest(baseQuery, routingResolver.getRouting(), clazz, index, false, true); 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 614f958cf..216c68753 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 @@ -1487,8 +1487,8 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu if (query instanceof NativeQuery nativeQuery) { prepareNativeSearch(nativeQuery, builder); } - // query.getSort() must be checked after prepareNativeSearch as this already might hav a sort set that must have - // higher priority + // query.getSort() must be checked after prepareNativeSearch as this already might have a sort set + // that must have higher priority if (query.getSort() != null) { List sortOptions = getSortOptions(query.getSort(), persistentEntity); @@ -1510,7 +1510,15 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu } if (!isEmpty(query.getSearchAfter())) { - builder.searchAfter(query.getSearchAfter().stream().map(TypeUtils::toFieldValue).toList()); + var fieldValues = query.getSearchAfter().stream().map(TypeUtils::toFieldValue).toList(); + + // when there is a field collapse on a native query, and we have a search_after, then the search_after + // must only have one entry + if (query instanceof NativeQuery nativeQuery && nativeQuery.getFieldCollapse() != null) { + builder.searchAfter(fieldValues.get(0)); + } else { + builder.searchAfter(fieldValues); + } } query.getRescorerQueries().forEach(rescorerQuery -> builder.rescore(getRescore(rescorerQuery))); diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java index b5aec9c92..6f0de2d24 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java @@ -15,14 +15,22 @@ */ package org.springframework.data.elasticsearch.repository.support; +import co.elastic.clients.elasticsearch.core.search.FieldCollapse; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.client.elc.NativeQuery; +import org.springframework.data.elasticsearch.client.elc.Queries; import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.test.context.ContextConfiguration; +import reactor.test.StepVerifier; /** * @author Peter-Josef Meisch @@ -51,4 +59,33 @@ QueryParameter queryParameter() { } } + /** + * search_after is used by the reactive search operation, it normally always adds _shard_doc as a tiebreaker sort + * parameter. This must not be done when a collapse field is used as sort field, as in that case the collapse field + * must be the only sort field. + */ + @Test // #2935 + @DisplayName("should use collapse_field for search_after in pit search") + void shouldUseCollapseFieldForSearchAfterI() { + var entity = new SampleEntity(); + entity.setId("42"); + entity.setMessage("m"); + entity.setKeyword("kw"); + repository.save(entity).block(); + + var query = NativeQuery.builder() + .withQuery(Queries.matchAllQueryAsQuery()) + .withPageable(Pageable.unpaged()) + .withFieldCollapse(FieldCollapse.of(fcb -> fcb + .field("keyword"))) + .withSort(Sort.by("keyword")) + .build(); + + operations.search(query, SampleEntity.class) + .as(StepVerifier::create) + .expectNextCount(1) + .verifyComplete(); + } + + } From 95e028a1e98890678323b3463d39d8c4176335cc Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 30 Jul 2024 06:56:32 +0200 Subject: [PATCH 024/131] Dependency updates and cleanup. Original Pull Request #2946 Closes #2945 --- pom.xml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 6589f3313..2384863dc 100644 --- a/pom.xml +++ b/pom.xml @@ -24,11 +24,11 @@ 8.14.1 1.0.9.RELEASE - 0.18.1 + 0.19.0 2.23.1 - 1.5.1 - 1.19.8 - 3.0.1 + 1.5.3 + 1.20.0 + 3.9.1 spring.data.elasticsearch @@ -132,17 +132,6 @@ - - org.elasticsearch.client - elasticsearch-rest-client - ${elasticsearch-java} - - - commons-logging - commons-logging - - - @@ -263,8 +252,8 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock ${wiremock} test From 8f8600727c110dff6413dd1b99071623db2b50bd Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 31 Jul 2024 14:53:15 +0200 Subject: [PATCH 025/131] Bundle Javadoc with Antora documentation site. Closes #2948. --- .gitignore | 1 - package.json | 10 ++++++++++ pom.xml | 2 +- src/main/antora/antora-playbook.yml | 8 +++----- src/main/antora/antora.yml | 5 +++++ src/main/antora/modules/ROOT/nav.adoc | 3 ++- .../ROOT/pages/elasticsearch/clients.adoc | 16 ++++++++-------- .../ROOT/pages/elasticsearch/template.adoc | 8 ++++---- .../junit/jupiter/ClusterConnection.java | 11 +---------- 9 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 package.json diff --git a/.gitignore b/.gitignore index ea0475e14..e4fe384b0 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,6 @@ target build/ node_modules node -package.json package-lock.json .mvn/.gradle-enterprise diff --git a/package.json b/package.json new file mode 100644 index 000000000..4689506b3 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "dependencies": { + "antora": "3.2.0-alpha.6", + "@antora/atlas-extension": "1.0.0-alpha.2", + "@antora/collector-extension": "1.0.0-alpha.7", + "@asciidoctor/tabs": "1.0.0-beta.6", + "@springio/antora-extensions": "1.13.0", + "@springio/asciidoctor-extensions": "1.0.0-alpha.11" + } +} diff --git a/pom.xml b/pom.xml index 2384863dc..9d3a870ab 100644 --- a/pom.xml +++ b/pom.xml @@ -468,7 +468,7 @@ - io.spring.maven.antora + org.antora antora-maven-plugin diff --git a/src/main/antora/antora-playbook.yml b/src/main/antora/antora-playbook.yml index 27404c0c1..5f4f76e06 100644 --- a/src/main/antora/antora-playbook.yml +++ b/src/main/antora/antora-playbook.yml @@ -3,8 +3,7 @@ # The purpose of this Antora playbook is to build the docs in the current branch. antora: extensions: - - '@antora/collector-extension' - - require: '@springio/antora-extensions/root-component-extension' + - require: '@springio/antora-extensions' root_component_name: 'data-elasticsearch' site: title: Spring Data Elasticsearch @@ -22,13 +21,12 @@ content: start_path: src/main/antora asciidoc: attributes: - page-pagination: '' hide-uri-scheme: '@' tabs-sync-option: '@' - chomp: 'all' extensions: - '@asciidoctor/tabs' - '@springio/asciidoctor-extensions' + - '@springio/asciidoctor-extensions/javadoc-extension' sourcemap: true urls: latest_version_segment: '' @@ -38,5 +36,5 @@ runtime: format: pretty ui: bundle: - url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip + url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip snapshot: true diff --git a/src/main/antora/antora.yml b/src/main/antora/antora.yml index 70364a772..2348fca61 100644 --- a/src/main/antora/antora.yml +++ b/src/main/antora/antora.yml @@ -10,3 +10,8 @@ ext: local: true scan: dir: target/classes/ + - run: + command: ./mvnw package -Pdistribute + local: true + scan: + dir: target/antora diff --git a/src/main/antora/modules/ROOT/nav.adoc b/src/main/antora/modules/ROOT/nav.adoc index 04b27c63b..9bd1c8411 100644 --- a/src/main/antora/modules/ROOT/nav.adoc +++ b/src/main/antora/modules/ROOT/nav.adoc @@ -41,4 +41,5 @@ ** xref:repositories/query-keywords-reference.adoc[] ** xref:repositories/query-return-types-reference.adoc[] -* https://github.com/spring-projects/spring-data-commons/wiki[Wiki] +* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank] +* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank] diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc index 0f8d8c102..0cf7d5ea3 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc @@ -31,7 +31,7 @@ public class MyClientConfig extends ElasticsearchConfiguration { <.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration] ==== -The `ElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods. +The javadoc:org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration[]] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods. The following beans can then be injected in other Spring components: @@ -52,13 +52,13 @@ RestClient restClient; <.> JsonpMapper jsonpMapper; <.> ---- -<.> an implementation of `ElasticsearchOperations` +<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] <.> the `co.elastic.clients.elasticsearch.ElasticsearchClient` that is used. <.> the low level `RestClient` from the Elasticsearch libraries <.> the `JsonpMapper` user by the Elasticsearch `Transport` ==== -Basically one should just use the `ElasticsearchOperations` to interact with the Elasticsearch cluster. +Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] to interact with the Elasticsearch cluster. When using repositories, this instance is used under the hood as well. [[elasticsearch.clients.reactiverestclient]] @@ -86,7 +86,7 @@ public class MyClientConfig extends ReactiveElasticsearchConfiguration { <.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration] ==== -The `ReactiveElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods. +The javadoc:org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods. The following beans can then be injected in other Spring components: @@ -108,20 +108,20 @@ JsonpMapper jsonpMapper; <.> the following can be injected: -<.> an implementation of `ReactiveElasticsearchOperations` +<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[] <.> the `org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient` that is used. This is a reactive implementation based on the Elasticsearch client implementation. <.> the low level `RestClient` from the Elasticsearch libraries <.> the `JsonpMapper` user by the Elasticsearch `Transport` ==== -Basically one should just use the `ReactiveElasticsearchOperations` to interact with the Elasticsearch cluster. +Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[] to interact with the Elasticsearch cluster. When using repositories, this instance is used under the hood as well. [[elasticsearch.clients.configuration]] == Client Configuration -Client behaviour can be changed via the `ClientConfiguration` that allows to set options for SSL, connect and socket timeouts, headers and other parameters. +Client behaviour can be changed via the javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] that allows to set options for SSL, connect and socket timeouts, headers and other parameters. .Client Configuration ==== @@ -178,7 +178,7 @@ If this is used in the reactive setup, the supplier function *must not* block! [[elasticsearch.clients.configuration.callbacks]] === Client configuration callbacks -The `ClientConfiguration` class offers the most common parameters to configure the client. +The javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] class offers the most common parameters to configure the client. In the case this is not enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback)` method. The following callbacks are provided: diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc index b893bb1a1..cf458c3b8 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc @@ -3,10 +3,10 @@ Spring Data Elasticsearch uses several interfaces to define the operations that can be called against an Elasticsearch index (for a description of the reactive interfaces see xref:elasticsearch/reactive-template.adoc[]). -* `IndexOperations` defines actions on index level like creating or deleting an index. -* `DocumentOperations` defines actions to store, update and retrieve entities based on their id. -* `SearchOperations` define the actions to search for multiple entities using queries -* `ElasticsearchOperations` combines the `DocumentOperations` and `SearchOperations` interfaces. +* javadoc:org.springframework.data.elasticsearch.core.IndexOperations[] defines actions on index level like creating or deleting an index. +* javadoc:org.springframework.data.elasticsearch.core.DocumentOperations[] defines actions to store, update and retrieve entities based on their id. +* javadoc:org.springframework.data.elasticsearch.core.SearchOperations[] define the actions to search for multiple entities using queries +* javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] combines the `DocumentOperations` and `SearchOperations` interfaces. These interfaces correspond to the structuring of the https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html[Elasticsearch API]. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java index 34247bfe9..57badfdd2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java @@ -132,7 +132,7 @@ private ClusterConnectionInfo startElasticsearchContainer() { DockerImageName dockerImageName = getDockerImageName(testcontainersProperties); ElasticsearchContainer elasticsearchContainer = new SpringDataElasticsearchContainer(dockerImageName) - .withEnv(testcontainersProperties).withStartupTimeout(Duration.ofMinutes(2)); + .withEnv(testcontainersProperties).withStartupTimeout(Duration.ofMinutes(2)).withReuse(true); elasticsearchContainer.start(); return ClusterConnectionInfo.builder() // @@ -192,16 +192,7 @@ private Map testcontainersProperties(String propertiesFile) { @Override public void close() { - if (clusterConnectionInfo != null && clusterConnectionInfo.getElasticsearchContainer() != null) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Stopping container"); - } - clusterConnectionInfo.getElasticsearchContainer().stop(); - } - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("closed"); - } } private static class SpringDataElasticsearchContainer extends ElasticsearchContainer { From 3fc19bbe8c77c2123f2aead77c5fabda4b569d1a Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Thu, 1 Aug 2024 07:53:14 -0500 Subject: [PATCH 026/131] Migrate build to Spring Develocity Conventions extension. * Migrate build to Spring Develocity Conventions extension. * Adopt Develocity environment variables. Closes #2944 --- .gitignore | 2 +- .mvn/extensions.xml | 11 +++-------- .mvn/gradle-enterprise.xml | 31 ------------------------------- Jenkinsfile | 6 ------ ci/clean.sh | 5 ----- ci/verify.sh | 6 ------ 6 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 .mvn/gradle-enterprise.xml diff --git a/.gitignore b/.gitignore index e4fe384b0..0b181452a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,4 @@ node_modules node package-lock.json -.mvn/.gradle-enterprise +.mvn/.develocity diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index ebd761025..1e3bb355f 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -1,13 +1,8 @@ - com.gradle - gradle-enterprise-maven-extension - 1.19.2 - - - com.gradle - common-custom-user-data-maven-extension - 1.12.4 + io.spring.develocity.conventions + develocity-conventions-maven-extension + 0.0.19 diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml deleted file mode 100644 index f88a885d0..000000000 --- a/.mvn/gradle-enterprise.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - https://ge.spring.io - - - false - true - true - - #{{'0.0.0.0'}} - - - - - true - - - - - ${env.GRADLE_ENTERPRISE_CACHE_USERNAME} - ${env.GRADLE_ENTERPRISE_CACHE_PASSWORD} - - - true - #{env['GRADLE_ENTERPRISE_CACHE_USERNAME'] != null and env['GRADLE_ENTERPRISE_CACHE_PASSWORD'] != null} - - - diff --git a/Jenkinsfile b/Jenkinsfile index b75f12236..3978651bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,6 @@ pipeline { environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } @@ -65,7 +64,6 @@ pipeline { options { timeout(time: 30, unit: 'MINUTES') } environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } steps { @@ -96,7 +94,6 @@ pipeline { options { timeout(time: 20, unit: 'MINUTES') } environment { ARTIFACTORY = credentials("${p['artifactory.credentials']}") - DEVELOCITY_CACHE = credentials("${p['develocity.cache.credentials']}") DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") } steps { @@ -104,9 +101,6 @@ pipeline { docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} " + - "DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} " + - "GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} " + "./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " + "-Dartifactory.server=${p['artifactory.url']} " + "-Dartifactory.username=${ARTIFACTORY_USR} " + diff --git a/ci/clean.sh b/ci/clean.sh index 34ba4ffcc..1d5a0b3f6 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -2,12 +2,7 @@ set -euo pipefail -export DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} -export DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} export JENKINS_USER=${JENKINS_USER_NAME} -# The environment variable to configure access key is still GRADLE_ENTERPRISE_ACCESS_KEY -export GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} - MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch diff --git a/ci/verify.sh b/ci/verify.sh index 98b9c79cc..1f34bbd93 100755 --- a/ci/verify.sh +++ b/ci/verify.sh @@ -4,14 +4,8 @@ set -euo pipefail mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch chown -R 1001:1001 . - -export DEVELOCITY_CACHE_USERNAME=${DEVELOCITY_CACHE_USR} -export DEVELOCITY_CACHE_PASSWORD=${DEVELOCITY_CACHE_PSW} export JENKINS_USER=${JENKINS_USER_NAME} -# The environment variable to configure access key is still GRADLE_ENTERPRISE_ACCESS_KEY -export GRADLE_ENTERPRISE_ACCESS_KEY=${DEVELOCITY_ACCESS_KEY} - MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ ./mvnw -s settings.xml \ -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch From eba8eec6c3f919421b47c27d85f11f18a46642f2 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 4 Aug 2024 11:46:04 +0200 Subject: [PATCH 027/131] Upgrade to Elasticsearch 8.14.3. Original Pull Request #2953 Closes #2947 --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 9d3a870ab..afec49ecf 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.14.1 + 8.14.3 1.0.9.RELEASE 0.19.0 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 8e1affb75..ab11f1f4a 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-4-0]] == New in Spring Data Elasticsearch 5.4 -* Upgrade to Elasticsearch 8.14.1. +* Upgrade to Elasticsearch 8.14.3. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 58c39e57b..319167f29 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 -| 2024.1 (in development) | 5.3.x | 8.14.1 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.14.3 | 6.1.x | 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 218d70081..92363da11 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.14.1 +sde.testcontainers.image-version=8.14.3 # # # 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 From 06de217ceb3d610da6a4171fe61436fee67ffd90 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Tue, 6 Aug 2024 12:04:37 -0400 Subject: [PATCH 028/131] Allow to customize the mapped type name for @InnerField and @Field annotations. Original Pull request: #2950 Closes #2942 --- .../data/elasticsearch/annotations/Field.java | 8 +++ .../elasticsearch/annotations/InnerField.java | 8 +++ .../core/index/MappingBuilder.java | 21 ++++-- .../core/index/MappingParameters.java | 5 +- .../index/MappingBuilderIntegrationTests.java | 7 ++ .../core/index/MappingBuilderUnitTests.java | 67 +++++++++++++++++++ 6 files changed, 110 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index 63f74716b..70ce5a867 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -38,6 +38,7 @@ * @author Morgan Lutz * @author Sascha Woo * @author Haibo Liu + * @author Andriy Redko */ @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.METHOD }) @@ -240,4 +241,11 @@ * @since 5.1 */ boolean storeEmptyValue() default true; + + /** + * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} + * + * @since 5.4 + */ + String mappedTypeName() default ""; } diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java index 35bccd968..49d83d016 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java @@ -30,6 +30,7 @@ * @author Brian Kimmig * @author Morgan Lutz * @author Haibo Liu + * @author Andriy Redko */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) @@ -171,4 +172,11 @@ * @since 5.4 */ KnnIndexOptions[] knnIndexOptions() default {}; + + /** + * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} + * + * @since 5.4 + */ + String mappedTypeName() default ""; } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java index bcf25c01b..86f7769aa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java @@ -69,6 +69,7 @@ * @author Peter-Josef Meisch * @author Xiao Yu * @author Subhobrata Dey + * @author Andriy Redko */ public class MappingBuilder { @@ -175,7 +176,8 @@ protected String buildPropertyMapping(ElasticsearchPersistentEntity entity, .findAnnotation(org.springframework.data.elasticsearch.annotations.Document.class); var dynamicMapping = docAnnotation != null ? docAnnotation.dynamic() : null; - mapEntity(objectNode, entity, true, "", false, FieldType.Auto, null, dynamicMapping, runtimeFields); + final FieldType fieldType = FieldType.Auto; + mapEntity(objectNode, entity, true, "", false, fieldType, fieldType.getMappedName(), null, dynamicMapping, runtimeFields); if (!excludeFromSource.isEmpty()) { ObjectNode sourceNode = objectNode.putObject(SOURCE); @@ -210,7 +212,7 @@ private void writeTypeHintMapping(ObjectNode propertiesNode) throws IOException } private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentEntity entity, - boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType, + boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType, String fieldTypeMappedName, @Nullable Field parentFieldAnnotation, @Nullable Dynamic dynamicMapping, @Nullable Document runtimeFields) throws IOException { @@ -244,7 +246,7 @@ private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentE boolean writeNestedProperties = !isRootObject && (isAnyPropertyAnnotatedWithField(entity) || nestedOrObjectField); if (writeNestedProperties) { - String type = nestedOrObjectField ? fieldType.getMappedName() : FieldType.Object.getMappedName(); + String type = nestedOrObjectField ? fieldTypeMappedName : FieldType.Object.getMappedName(); ObjectNode nestedObjectNode = objectMapper.createObjectNode(); nestedObjectNode.put(FIELD_PARAM_TYPE, type); @@ -370,7 +372,7 @@ private void buildPropertyMapping(ObjectNode propertiesNode, boolean isRootObjec nestedPropertyPrefix = nestedPropertyPath; mapEntity(propertiesNode, persistentEntity, false, property.getFieldName(), true, fieldAnnotation.type(), - fieldAnnotation, dynamicMapping, null); + getMappedTypeName(fieldAnnotation), fieldAnnotation, dynamicMapping, null); nestedPropertyPrefix = currentNestedPropertyPrefix; return; @@ -473,7 +475,7 @@ private void applyDisabledPropertyMapping(ObjectNode propertiesNode, Elasticsear } propertiesNode.set(property.getFieldName(), objectMapper.createObjectNode() // - .put(FIELD_PARAM_TYPE, field.type().getMappedName()) // + .put(FIELD_PARAM_TYPE, getMappedTypeName(field)) // .put(MAPPING_ENABLED, false) // ); @@ -482,6 +484,15 @@ private void applyDisabledPropertyMapping(ObjectNode propertiesNode, Elasticsear } } + /** + * Return the mapping type name to be used for the {@link Field} + * @param field field to return the mapping type name for + * @return the mapping type name + */ + private String getMappedTypeName(Field field) { + return StringUtils.hasText(field.mappedTypeName()) ? field.mappedTypeName() : field.type().getMappedName(); + } + /** * Add mapping for @Field annotation * diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java index cd3903376..7875a7d5e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java @@ -116,6 +116,7 @@ public final class MappingParameters { private final boolean store; private final TermVector termVector; private final FieldType type; + private final String mappedTypeName; /** * extracts the mapping parameters from the relevant annotations. @@ -141,6 +142,7 @@ private MappingParameters(Field field) { store = field.store(); fielddata = field.fielddata(); type = field.type(); + mappedTypeName = StringUtils.hasText(field.mappedTypeName()) ? field.mappedTypeName() : type.getMappedName(); dateFormats = field.format(); dateFormatPatterns = field.pattern(); analyzer = field.analyzer(); @@ -187,6 +189,7 @@ private MappingParameters(InnerField field) { store = field.store(); fielddata = field.fielddata(); type = field.type(); + mappedTypeName = StringUtils.hasText(field.mappedTypeName()) ? field.mappedTypeName() : type.getMappedName(); dateFormats = field.format(); dateFormatPatterns = field.pattern(); analyzer = field.analyzer(); @@ -245,7 +248,7 @@ public void writeTypeAndParametersTo(ObjectNode objectNode) throws IOException { } if (type != FieldType.Auto) { - objectNode.put(FIELD_PARAM_TYPE, type.getMappedName()); + objectNode.put(FIELD_PARAM_TYPE, mappedTypeName); if (type == FieldType.Date || type == FieldType.Date_Nanos || type == FieldType.Date_Range) { List formats = new ArrayList<>(); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index e4bf6e48d..b4aaab0e9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -59,6 +59,7 @@ * @author Brian Kimmig * @author Morgan Lutz * @author Haibo Liu + * @author Andriy Redko */ @SpringIntegrationTest public abstract class MappingBuilderIntegrationTests extends MappingContextBaseTests { @@ -77,6 +78,12 @@ void cleanup() { operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete(); } + @Test + public void shouldSupportAllTypes() { + IndexOperations indexOperations = operations.indexOps(EntityWithAllTypes.class); + indexOperations.createWithMapping(); + } + @Test public void shouldNotFailOnCircularReference() { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index cf5ac6f3b..2335d2c61 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -63,6 +63,7 @@ * @author Brian Kimmig * @author Morgan Lutz * @author Haibo Liu + * @author Andriy Redko */ public class MappingBuilderUnitTests extends MappingContextBaseTests { @@ -1242,6 +1243,59 @@ void shouldWriteFieldAliasesToTheMapping() throws JSONException { assertEquals(expected, mapping, true); } + + @Test // #2942 + @DisplayName("should use custom mapped name") + void shouldUseCustomMappedName() throws JSONException { + + var expected = """ + { + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "someText": { + "type": "match_only_text" + } + } + } + """; + String mapping = getMappingBuilder().buildPropertyMapping(FieldMappedNameEntity.class); + + assertEquals(expected, mapping, true); + } + + @Test // #2942 + @DisplayName("should use custom mapped name for multifield") + void shouldUseCustomMappedNameMultiField() throws JSONException { + + var expected = """ + { + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "description": { + "type": "match_only_text", + "fields": { + "lower_case": { + "type": "constant_keyword", + "normalizer": "lower_case_normalizer" + } + } + } + } + } + """; + String mapping = getMappingBuilder().buildPropertyMapping(MultiFieldMappedNameEntity.class); + + assertEquals(expected, mapping, true); + } + // region entities @Document(indexName = "ignore-above-index") @@ -2503,5 +2557,18 @@ private static class FieldAliasEntity { @Nullable @Field(type = Text) private String otherText; } + + @SuppressWarnings("unused") + private static class FieldMappedNameEntity { + @Nullable + @Field(type = Text, mappedTypeName = "match_only_text") private String someText; + } + + @SuppressWarnings("unused") + private static class MultiFieldMappedNameEntity { + @Nullable + @MultiField(mainField = @Field(type = FieldType.Text, mappedTypeName = "match_only_text"), otherFields = { @InnerField(suffix = "lower_case", + type = FieldType.Keyword, normalizer = "lower_case_normalizer", mappedTypeName = "constant_keyword") }) private String description; + } // endregion } From 03992ba722746207c61563c97aa1b936b73324d2 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 6 Aug 2024 18:14:33 +0200 Subject: [PATCH 029/131] Polishing --- .../ROOT/pages/elasticsearch/elasticsearch-new.adoc | 1 + .../data/elasticsearch/annotations/Field.java | 2 +- .../data/elasticsearch/annotations/InnerField.java | 2 +- .../data/elasticsearch/core/index/MappingBuilder.java | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) 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 ab11f1f4a..fe0d86575 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -5,6 +5,7 @@ == New in Spring Data Elasticsearch 5.4 * Upgrade to Elasticsearch 8.14.3. +* Allow to customize the mapped type name for @InnerField and @Field annotations. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index 70ce5a867..a3a55e650 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -241,7 +241,7 @@ * @since 5.1 */ boolean storeEmptyValue() default true; - + /** * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} * diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java index 49d83d016..46dae4d75 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java @@ -172,7 +172,7 @@ * @since 5.4 */ KnnIndexOptions[] knnIndexOptions() default {}; - + /** * overrides the field type in the mapping which otherwise will be taken from corresponding {@link FieldType} * diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java index 86f7769aa..97bbc186b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java @@ -177,7 +177,8 @@ protected String buildPropertyMapping(ElasticsearchPersistentEntity entity, var dynamicMapping = docAnnotation != null ? docAnnotation.dynamic() : null; final FieldType fieldType = FieldType.Auto; - mapEntity(objectNode, entity, true, "", false, fieldType, fieldType.getMappedName(), null, dynamicMapping, runtimeFields); + mapEntity(objectNode, entity, true, "", false, fieldType, fieldType.getMappedName(), null, dynamicMapping, + runtimeFields); if (!excludeFromSource.isEmpty()) { ObjectNode sourceNode = objectNode.putObject(SOURCE); @@ -212,7 +213,8 @@ private void writeTypeHintMapping(ObjectNode propertiesNode) throws IOException } private void mapEntity(ObjectNode objectNode, @Nullable ElasticsearchPersistentEntity entity, - boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType, String fieldTypeMappedName, + boolean isRootObject, String nestedObjectFieldName, boolean nestedOrObjectField, FieldType fieldType, + String fieldTypeMappedName, @Nullable Field parentFieldAnnotation, @Nullable Dynamic dynamicMapping, @Nullable Document runtimeFields) throws IOException { @@ -486,6 +488,7 @@ private void applyDisabledPropertyMapping(ObjectNode propertiesNode, Elasticsear /** * Return the mapping type name to be used for the {@link Field} + * * @param field field to return the mapping type name for * @return the mapping type name */ From 738ee54a250382dfc06ea7f056e887d749dfc6ab Mon Sep 17 00:00:00 2001 From: Aouichaoui Youssef <21143371+youssef3wi@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:32:26 +0200 Subject: [PATCH 030/131] Support for SQL. Original Pull Request: #2949 Closes: #2683 --- .../client/elc/ElasticsearchTemplate.java | 19 + .../elc/ReactiveElasticsearchClient.java | 4 + .../elc/ReactiveElasticsearchSqlClient.java | 72 +++ .../elc/ReactiveElasticsearchTemplate.java | 12 + .../client/elc/RequestConverter.java | 17 + .../client/elc/ResponseConverter.java | 76 ++- .../core/ElasticsearchOperations.java | 3 +- .../core/ReactiveElasticsearchOperations.java | 3 +- .../elasticsearch/core/query/SqlQuery.java | 433 ++++++++++++++++++ .../core/sql/ReactiveSqlOperations.java | 37 ++ .../elasticsearch/core/sql/SqlOperations.java | 35 ++ .../elasticsearch/core/sql/SqlResponse.java | 217 +++++++++ .../elasticsearch/core/sql/package-info.java | 6 + ...ReactiveSqlOperationsIntegrationTests.java | 124 +++++ .../sql/SqlOperationsIntegrationTests.java | 143 ++++++ 15 files changed, 1180 insertions(+), 21 deletions(-) create mode 100644 src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java index 444d744ab..49a0b5a00 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java @@ -23,6 +23,8 @@ import co.elastic.clients.elasticsearch.core.bulk.BulkResponseItem; import co.elastic.clients.elasticsearch.core.msearch.MultiSearchResponseItem; import co.elastic.clients.elasticsearch.core.search.ResponseBody; +import co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient; +import co.elastic.clients.elasticsearch.sql.QueryResponse; import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.transport.Version; @@ -56,6 +58,7 @@ 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; @@ -74,6 +77,7 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate { private static final Log LOGGER = LogFactory.getLog(ElasticsearchTemplate.class); private final ElasticsearchClient client; + private final ElasticsearchSqlClient sqlClient; private final RequestConverter requestConverter; private final ResponseConverter responseConverter; private final JsonpMapper jsonpMapper; @@ -85,6 +89,7 @@ public ElasticsearchTemplate(ElasticsearchClient client) { Assert.notNull(client, "client must not be null"); this.client = client; + this.sqlClient = client.sql(); this.jsonpMapper = client._transport().jsonpMapper(); requestConverter = new RequestConverter(elasticsearchConverter, jsonpMapper); responseConverter = new ResponseConverter(jsonpMapper); @@ -97,6 +102,7 @@ public ElasticsearchTemplate(ElasticsearchClient client, ElasticsearchConverter Assert.notNull(client, "client must not be null"); this.client = client; + this.sqlClient = client.sql(); this.jsonpMapper = client._transport().jsonpMapper(); requestConverter = new RequestConverter(elasticsearchConverter, jsonpMapper); responseConverter = new ResponseConverter(jsonpMapper); @@ -656,6 +662,19 @@ public boolean deleteScript(String name) { DeleteScriptRequest request = requestConverter.scriptDelete(name); return execute(client -> client.deleteScript(request)).acknowledged(); } + + @Override + public SqlResponse search(SqlQuery query) { + Assert.notNull(query, "Query must not be null."); + + try { + QueryResponse response = sqlClient.query(requestConverter.sqlQueryRequest(query)); + + return responseConverter.sqlResponse(response); + } catch (IOException e) { + throw exceptionTranslator.translateException(e); + } + } // endregion // region client callback diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index e998faf4b..040625a12 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -69,6 +69,10 @@ public ReactiveElasticsearchIndicesClient indices() { return new ReactiveElasticsearchIndicesClient(transport, transportOptions); } + public ReactiveElasticsearchSqlClient sql() { + return new ReactiveElasticsearchSqlClient(transport, transportOptions); + } + // endregion // region info diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java new file mode 100644 index 000000000..442c5c5a9 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java @@ -0,0 +1,72 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.client.elc; + +import java.io.IOException; +import java.util.function.Function; + +import org.jetbrains.annotations.Nullable; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch.sql.QueryRequest; +import co.elastic.clients.elasticsearch.sql.QueryResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import reactor.core.publisher.Mono; + +/** + * Reactive version of {@link co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient}. + * + * @author Aouichaoui Youssef + * @since 5.4 + */ +public class ReactiveElasticsearchSqlClient extends ApiClient { + public ReactiveElasticsearchSqlClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ReactiveElasticsearchSqlClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ReactiveElasticsearchSqlClient(transport, transportOptions); + } + + /** + * Executes a SQL request + * + * @param fn a function that initializes a builder to create the {@link QueryRequest}. + */ + public final Mono query(Function> fn) + throws IOException, ElasticsearchException { + return query(fn.apply(new QueryRequest.Builder()).build()); + } + + /** + * Executes a SQL request. + */ + public Mono query(QueryRequest query) { + return Mono.fromFuture(transport.performRequestAsync(query, QueryRequest._ENDPOINT, transportOptions)); + } + + /** + * Executes a SQL request. + */ + public Mono query() { + return Mono.fromFuture( + transport.performRequestAsync(new QueryRequest.Builder().build(), QueryRequest._ENDPOINT, transportOptions)); + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index 5f4fd0360..aa18c0f74 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -25,6 +25,8 @@ import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.transport.Version; import co.elastic.clients.transport.endpoints.BooleanResponse; +import org.springframework.data.elasticsearch.core.query.SqlQuery; +import org.springframework.data.elasticsearch.core.sql.SqlResponse; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; @@ -88,6 +90,7 @@ public class ReactiveElasticsearchTemplate extends AbstractReactiveElasticsearch private static final Log LOGGER = LogFactory.getLog(ReactiveElasticsearchTemplate.class); private final ReactiveElasticsearchClient client; + private final ReactiveElasticsearchSqlClient sqlClient; private final RequestConverter requestConverter; private final ResponseConverter responseConverter; private final JsonpMapper jsonpMapper; @@ -99,6 +102,7 @@ public ReactiveElasticsearchTemplate(ReactiveElasticsearchClient client, Elastic Assert.notNull(client, "client must not be null"); this.client = client; + this.sqlClient = client.sql(); this.jsonpMapper = client._transport().jsonpMapper(); requestConverter = new RequestConverter(converter, jsonpMapper); responseConverter = new ResponseConverter(jsonpMapper); @@ -646,6 +650,14 @@ public BaseQueryBuilder queryBuilderWithIds(List ids) { return NativeQuery.builder().withIds(ids); } + @Override + public Mono search(SqlQuery query) { + Assert.notNull(query, "Query must not be null."); + + co.elastic.clients.elasticsearch.sql.QueryRequest request = requestConverter.sqlQueryRequest(query); + return sqlClient.query(request).onErrorMap(this::translateException).map(responseConverter::sqlResponse); + } + /** * Callback interface to be used with {@link #execute(ReactiveElasticsearchTemplate.ClientCallback<>)} for operating * directly on {@link ReactiveElasticsearchClient}. 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 216c68753..6c3836701 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 @@ -68,6 +68,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -530,6 +531,22 @@ public co.elastic.clients.elasticsearch.indices.GetTemplateRequest indicesGetTem .of(gtr -> gtr.name(getTemplateRequest.getTemplateName()).flatSettings(true)); } + public co.elastic.clients.elasticsearch.sql.QueryRequest sqlQueryRequest(SqlQuery query) { + Assert.notNull(query, "Query must not be null."); + + return co.elastic.clients.elasticsearch.sql.QueryRequest.of(sqb -> { + sqb.query(query.getQuery()).catalog(query.getCatalog()).columnar(query.getColumnar()).cursor(query.getCursor()) + .fetchSize(query.getFetchSize()).fieldMultiValueLeniency(query.getFieldMultiValueLeniency()) + .indexUsingFrozen(query.getIndexIncludeFrozen()).keepAlive(time(query.getKeepAlive())) + .keepOnCompletion(query.getKeepOnCompletion()).pageTimeout(time(query.getPageTimeout())) + .requestTimeout(time(query.getRequestTimeout())) + .waitForCompletionTimeout(time(query.getWaitForCompletionTimeout())).filter(getQuery(query.getFilter(), null)) + .timeZone(Objects.toString(query.getTimeZone(), null)).format("json"); + + return sqb; + }); + } + // endregion // region documents 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 1dada5d11..232de0151 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 @@ -15,25 +15,9 @@ */ package org.springframework.data.elasticsearch.client.elc; -import static org.springframework.data.elasticsearch.client.elc.JsonUtils.*; -import static org.springframework.data.elasticsearch.client.elc.TypeUtils.*; - -import co.elastic.clients.elasticsearch._types.BulkIndexByScrollFailure; -import co.elastic.clients.elasticsearch._types.ErrorCause; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch.cluster.ComponentTemplateSummary; -import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateResponse; -import co.elastic.clients.elasticsearch.cluster.HealthResponse; -import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; -import co.elastic.clients.elasticsearch.core.GetScriptResponse; -import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; -import co.elastic.clients.elasticsearch.core.mget.MultiGetError; -import co.elastic.clients.elasticsearch.core.mget.MultiGetResponseItem; -import co.elastic.clients.elasticsearch.indices.*; -import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; -import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; -import co.elastic.clients.json.JsonpMapper; +import static org.springframework.data.elasticsearch.client.elc.JsonUtils.toJson; +import static org.springframework.data.elasticsearch.client.elc.TypeUtils.removePrefixFromJson; +import static org.springframework.data.elasticsearch.client.elc.TypeUtils.typeMapping; import java.util.ArrayList; import java.util.HashMap; @@ -61,10 +45,41 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; 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.data.elasticsearch.support.DefaultStringObjectMap; import org.springframework.lang.Nullable; import org.springframework.util.Assert; +import co.elastic.clients.elasticsearch._types.BulkIndexByScrollFailure; +import co.elastic.clients.elasticsearch._types.ErrorCause; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch.cluster.ComponentTemplateSummary; +import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateResponse; +import co.elastic.clients.elasticsearch.cluster.HealthResponse; +import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; +import co.elastic.clients.elasticsearch.core.GetScriptResponse; +import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; +import co.elastic.clients.elasticsearch.core.mget.MultiGetError; +import co.elastic.clients.elasticsearch.core.mget.MultiGetResponseItem; +import co.elastic.clients.elasticsearch.indices.Alias; +import co.elastic.clients.elasticsearch.indices.AliasDefinition; +import co.elastic.clients.elasticsearch.indices.GetAliasResponse; +import co.elastic.clients.elasticsearch.indices.GetIndexResponse; +import co.elastic.clients.elasticsearch.indices.GetIndexTemplateResponse; +import co.elastic.clients.elasticsearch.indices.GetIndicesSettingsResponse; +import co.elastic.clients.elasticsearch.indices.GetMappingResponse; +import co.elastic.clients.elasticsearch.indices.GetTemplateResponse; +import co.elastic.clients.elasticsearch.indices.IndexSettings; +import co.elastic.clients.elasticsearch.indices.IndexState; +import co.elastic.clients.elasticsearch.indices.IndexTemplateSummary; +import co.elastic.clients.elasticsearch.indices.TemplateMapping; +import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; +import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; +import co.elastic.clients.elasticsearch.sql.QueryResponse; +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonpMapper; + /** * Class to convert Elasticsearch responses into Spring Data Elasticsearch classes. * @@ -536,6 +551,29 @@ public Script scriptResponse(GetScriptResponse response) { } // endregion + // region sql + public SqlResponse sqlResponse(QueryResponse response) { + SqlResponse.Builder builder = SqlResponse.builder(); + builder.withRunning(Boolean.TRUE.equals(response.isRunning())) + .withPartial(Boolean.TRUE.equals(response.isPartial())).withCursor(response.cursor()); + + final List columns = response.columns().stream() + .map(column -> new SqlResponse.Column(column.name(), column.type())).toList(); + builder.withColumns(columns); + + for (List rowValues : response.rows()) { + SqlResponse.Row.Builder rowBuilder = SqlResponse.Row.builder(); + for (int idx = 0; idx < rowValues.size(); idx++) { + rowBuilder.withValue(columns.get(idx), rowValues.get(idx).toJson()); + } + + builder.withRow(rowBuilder.build()); + } + + return builder.build(); + } + // end region + // region helper functions private long timeToLong(Time time) { diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java index 324886892..b1427bcc1 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java @@ -20,6 +20,7 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.routing.RoutingResolver; import org.springframework.data.elasticsearch.core.script.ScriptOperations; +import org.springframework.data.elasticsearch.core.sql.SqlOperations; import org.springframework.lang.Nullable; /** @@ -35,7 +36,7 @@ * @author Dmitriy Yakovlev * @author Peter-Josef Meisch */ -public interface ElasticsearchOperations extends DocumentOperations, SearchOperations, ScriptOperations { +public interface ElasticsearchOperations extends DocumentOperations, SearchOperations, ScriptOperations, SqlOperations { /** * get an {@link IndexOperations} that is bound to the given class diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java index 7be0efe44..34679a9d5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java @@ -21,6 +21,7 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.routing.RoutingResolver; import org.springframework.data.elasticsearch.core.script.ReactiveScriptOperations; +import org.springframework.data.elasticsearch.core.sql.ReactiveSqlOperations; import org.springframework.lang.Nullable; /** @@ -31,7 +32,7 @@ * @since 3.2 */ public interface ReactiveElasticsearchOperations - extends ReactiveDocumentOperations, ReactiveSearchOperations, ReactiveScriptOperations { + extends ReactiveDocumentOperations, ReactiveSearchOperations, ReactiveScriptOperations, ReactiveSqlOperations { /** * Get the {@link ElasticsearchConverter} used. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java new file mode 100644 index 000000000..dbee7ef86 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java @@ -0,0 +1,433 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.query; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.TimeZone; + +import org.springframework.lang.Nullable; +import org.springframework.util.Assert; + +/** + * Defines an SQL request. + * + * @author Aouichaoui Youssef + * @see docs + * @since 5.4 + */ +public class SqlQuery { + + /** + * If true, returns partial results if there are shard request timeouts or shard failures. + *

+ * Default, this is set to {@code false}. + */ + @Nullable private final Boolean allowPartialSearchResults; + + /** + * Default catalog/cluster for queries. If unspecified, the queries are executed on the data in the local cluster + * only. + */ + @Nullable private final String catalog; + + /** + * If true, returns results in a columnar format. + *

+ * Default, this is set to {@code false}. + */ + @Nullable private final Boolean columnar; + + /** + * To retrieve a set of paginated results, ignore other request body parameters when specifying a cursor and using the + * {@link #columnar} and {@link #timeZone} parameters. + */ + @Nullable private final String cursor; + + /** + * Maximum number of rows to return in the response. + *

+ * Default, this is set to {@code 1000}. + */ + @Nullable private final Integer fetchSize; + + /** + * If false, the API returns an error for fields containing array values. + *

+ * Default, this is set to {@code false}. + */ + @Nullable private final Boolean fieldMultiValueLeniency; + + /** + * Query that filter documents for the SQL search. + */ + @Nullable private final Query filter; + + /** + * If true, the search can run on frozen indices. + *

+ * Default, this is set to {@code false}. + */ + @Nullable private final Boolean indexIncludeFrozen; + + /** + * Retention period for an async or saved synchronous search. + *

+ * Default, this is set to {@code 5 days}. + */ + @Nullable private final Duration keepAlive; + + /** + * If it is true, it will store synchronous searches when the {@link #waitForCompletionTimeout} parameter is + * specified. + */ + @Nullable private final Boolean keepOnCompletion; + + /** + * Minimum retention period for the scroll cursor. + *

+ * Default, this is set to {@code 45 seconds}. + */ + @Nullable private final Duration pageTimeout; + + /** + * Timeout before the request fails. + *

+ * Default, this is set to {@code 90 seconds}. + */ + @Nullable private final Duration requestTimeout; + + /** + * Values for parameters in the query. + */ + @Nullable private final List params; + + /** + * SQL query to run. + */ + private final String query; + + /** + * Time zone ID for the search. + *

+ * Default, this is set to {@code UTC}. + */ + @Nullable private final TimeZone timeZone; + + /** + * Period to wait for complete results. + *

+ * Default, this is set to no timeout. + */ + @Nullable private final Duration waitForCompletionTimeout; + + private SqlQuery(Builder builder) { + this.allowPartialSearchResults = builder.allowPartialSearchResults; + + this.catalog = builder.catalog; + this.columnar = builder.columnar; + this.cursor = builder.cursor; + + this.fetchSize = builder.fetchSize; + this.fieldMultiValueLeniency = builder.fieldMultiValueLeniency; + + this.filter = builder.filter; + + this.indexIncludeFrozen = builder.indexIncludeFrozen; + this.keepAlive = builder.keepAlive; + this.keepOnCompletion = builder.keepOnCompletion; + + this.pageTimeout = builder.pageTimeout; + this.requestTimeout = builder.requestTimeout; + + this.params = builder.params; + this.query = builder.query; + + this.timeZone = builder.timeZone; + this.waitForCompletionTimeout = builder.waitForCompletionTimeout; + } + + @Nullable + public Boolean getAllowPartialSearchResults() { + return allowPartialSearchResults; + } + + @Nullable + public String getCatalog() { + return catalog; + } + + @Nullable + public Boolean getColumnar() { + return columnar; + } + + @Nullable + public String getCursor() { + return cursor; + } + + @Nullable + public Integer getFetchSize() { + return fetchSize; + } + + @Nullable + public Boolean getFieldMultiValueLeniency() { + return fieldMultiValueLeniency; + } + + @Nullable + public Query getFilter() { + return filter; + } + + @Nullable + public Boolean getIndexIncludeFrozen() { + return indexIncludeFrozen; + } + + @Nullable + public Duration getKeepAlive() { + return keepAlive; + } + + @Nullable + public Boolean getKeepOnCompletion() { + return keepOnCompletion; + } + + @Nullable + public Duration getPageTimeout() { + return pageTimeout; + } + + @Nullable + public Duration getRequestTimeout() { + return requestTimeout; + } + + @Nullable + public List getParams() { + return params; + } + + public String getQuery() { + return query; + } + + @Nullable + public TimeZone getTimeZone() { + return timeZone; + } + + @Nullable + public Duration getWaitForCompletionTimeout() { + return waitForCompletionTimeout; + } + + public static Builder builder(String query) { + return new Builder(query); + } + + public static class Builder { + @Nullable private Boolean allowPartialSearchResults; + + @Nullable private String catalog; + @Nullable private Boolean columnar; + @Nullable private String cursor; + + @Nullable private Integer fetchSize; + @Nullable private Boolean fieldMultiValueLeniency; + + @Nullable private Query filter; + + @Nullable private Boolean indexIncludeFrozen; + + @Nullable private Duration keepAlive; + @Nullable private Boolean keepOnCompletion; + + @Nullable private Duration pageTimeout; + @Nullable private Duration requestTimeout; + + @Nullable private List params; + private final String query; + + @Nullable private TimeZone timeZone; + @Nullable private Duration waitForCompletionTimeout; + + private Builder(String query) { + Assert.notNull(query, "query must not be null"); + + this.query = query; + } + + /** + * If true, returns partial results if there are shard request timeouts or shard failures. + */ + public Builder withAllowPartialSearchResults(Boolean allowPartialSearchResults) { + this.allowPartialSearchResults = allowPartialSearchResults; + + return this; + } + + /** + * Default catalog/cluster for queries. If unspecified, the queries are executed on the data in the local cluster + * only. + */ + public Builder withCatalog(String catalog) { + this.catalog = catalog; + + return this; + } + + /** + * If true, returns results in a columnar format. + */ + public Builder withColumnar(Boolean columnar) { + this.columnar = columnar; + + return this; + } + + /** + * To retrieve a set of paginated results, ignore other request body parameters when specifying a cursor and using + * the {@link #columnar} and {@link #timeZone} parameters. + */ + public Builder withCursor(String cursor) { + this.cursor = cursor; + + return this; + } + + /** + * Maximum number of rows to return in the response. + */ + public Builder withFetchSize(Integer fetchSize) { + this.fetchSize = fetchSize; + + return this; + } + + /** + * If false, the API returns an error for fields containing array values. + */ + public Builder withFieldMultiValueLeniency(Boolean fieldMultiValueLeniency) { + this.fieldMultiValueLeniency = fieldMultiValueLeniency; + + return this; + } + + /** + * Query that filter documents for the SQL search. + */ + public Builder setFilter(Query filter) { + this.filter = filter; + + return this; + } + + /** + * If true, the search can run on frozen indices. + */ + public Builder withIndexIncludeFrozen(Boolean indexIncludeFrozen) { + this.indexIncludeFrozen = indexIncludeFrozen; + + return this; + } + + /** + * Retention period for an async or saved synchronous search. + */ + public Builder setKeepAlive(Duration keepAlive) { + this.keepAlive = keepAlive; + + return this; + } + + /** + * If it is true, it will store synchronous searches when the {@link #waitForCompletionTimeout} parameter is + * specified. + */ + public Builder withKeepOnCompletion(Boolean keepOnCompletion) { + this.keepOnCompletion = keepOnCompletion; + + return this; + } + + /** + * Minimum retention period for the scroll cursor. + */ + public Builder withPageTimeout(Duration pageTimeout) { + this.pageTimeout = pageTimeout; + + return this; + } + + /** + * Timeout before the request fails. + */ + public Builder withRequestTimeout(Duration requestTimeout) { + this.requestTimeout = requestTimeout; + + return this; + } + + /** + * Values for parameters in the query. + */ + public Builder withParams(List params) { + this.params = params; + + return this; + } + + /** + * Value for parameters in the query. + */ + public Builder withParam(Object param) { + if (this.params == null) { + this.params = new ArrayList<>(); + } + this.params.add(param); + + return this; + } + + /** + * Time zone ID for the search. + */ + public Builder withTimeZone(TimeZone timeZone) { + this.timeZone = timeZone; + + return this; + } + + /** + * Period to wait for complete results. + */ + public Builder withWaitForCompletionTimeout(Duration waitForCompletionTimeout) { + this.waitForCompletionTimeout = waitForCompletionTimeout; + + return this; + } + + public SqlQuery build() { + return new SqlQuery(this); + } + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java new file mode 100644 index 000000000..6988026fa --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java @@ -0,0 +1,37 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.sql; + +import org.springframework.data.elasticsearch.core.query.SqlQuery; + +import reactor.core.publisher.Mono; + +/** + * The reactive version of operations for the + * SQL search API. + * + * @author Aouichaoui Youssef + * @since 5.4 + */ +public interface ReactiveSqlOperations { + /** + * Execute the sql {@code query} against elasticsearch and return result as {@link SqlResponse} + * + * @param query the query to execute + * @return {@link SqlResponse} containing the list of found objects + */ + Mono search(SqlQuery query); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java new file mode 100644 index 000000000..3c1b3fc69 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java @@ -0,0 +1,35 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.sql; + +import org.springframework.data.elasticsearch.core.query.SqlQuery; + +/** + * The operations for the + * SQL search API. + * + * @author Aouichaoui Youssef + * @since 5.4 + */ +public interface SqlOperations { + /** + * Execute the sql {@code query} against elasticsearch and return result as {@link SqlResponse} + * + * @param query the query to execute + * @return {@link SqlResponse} containing the list of found objects + */ + SqlResponse search(SqlQuery query); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java new file mode 100644 index 000000000..4436c419a --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java @@ -0,0 +1,217 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.sql; + +import static java.util.Collections.unmodifiableList; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.springframework.lang.NonNull; +import org.springframework.lang.Nullable; + +import jakarta.json.JsonValue; + +/** + * Defines an SQL response. + * + * @author Aouichaoui Youssef + * @see docs + * @since 5.4 + */ +public class SqlResponse { + /** + * If {@code true}, the search is still running. + */ + private final boolean running; + + /** + * If {@code true}, the response does not contain complete search results. + */ + private final boolean partial; + + /** + * Cursor for the next set of paginated results. + */ + @Nullable private final String cursor; + + /** + * Column headings for the search results. + */ + private final List columns; + + /** + * Values for the search results. + */ + private final List rows; + + private SqlResponse(Builder builder) { + this.running = builder.running; + this.partial = builder.partial; + + this.cursor = builder.cursor; + + this.columns = unmodifiableList(builder.columns); + this.rows = unmodifiableList(builder.rows); + } + + public boolean isRunning() { + return running; + } + + public boolean isPartial() { + return partial; + } + + @Nullable + public String getCursor() { + return cursor; + } + + public List getColumns() { + return columns; + } + + public List getRows() { + return rows; + } + + public static Builder builder() { + return new Builder(); + } + + public record Column(String name, String type) { + } + + public static class Row implements Iterable> { + private final Map row; + + private Row(Builder builder) { + this.row = builder.row; + } + + public static Builder builder() { + return new Builder(); + } + + @NonNull + @Override + public Iterator> iterator() { + return row.entrySet().iterator(); + } + + @Nullable + public JsonValue get(Column column) { + return row.get(column); + } + + public static class Builder { + private final Map row = new HashMap<>(); + + public Builder withValue(Column column, JsonValue value) { + this.row.put(column, value); + + return this; + } + + public Row build() { + return new Row(this); + } + } + } + + public static class Builder { + private boolean running; + private boolean partial; + + @Nullable private String cursor; + + private final List columns = new ArrayList<>(); + private final List rows = new ArrayList<>(); + + private Builder() {} + + /** + * If {@code true}, the search is still running. + */ + public Builder withRunning(boolean running) { + this.running = running; + + return this; + } + + /** + * If {@code true}, the response does not contain complete search results. + */ + public Builder withPartial(boolean partial) { + this.partial = partial; + + return this; + } + + /** + * Cursor for the next set of paginated results. + */ + public Builder withCursor(@Nullable String cursor) { + this.cursor = cursor; + + return this; + } + + /** + * Column headings for the search results. + */ + public Builder withColumns(List columns) { + this.columns.addAll(columns); + + return this; + } + + /** + * Column heading for the search results. + */ + public Builder withColumn(Column column) { + this.columns.add(column); + + return this; + } + + /** + * Values for the search results. + */ + public Builder withRows(List rows) { + this.rows.addAll(rows); + + return this; + } + + /** + * Value for the search results. + */ + public Builder withRow(Row row) { + this.rows.add(row); + + return this; + } + + public SqlResponse build() { + return new SqlResponse(this); + } + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java new file mode 100644 index 000000000..306bceade --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java @@ -0,0 +1,6 @@ +/** + * Classes and interfaces to access to SQL API of Elasticsearch. + */ +@org.springframework.lang.NonNullApi +@org.springframework.lang.NonNullFields +package org.springframework.data.elasticsearch.core.sql; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java new file mode 100644 index 000000000..8836894d5 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java @@ -0,0 +1,124 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.sql; + +import static org.springframework.data.elasticsearch.core.IndexOperationsAdapter.blocking; + +import java.util.List; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.SqlQuery; +import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchTemplateConfiguration; +import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; +import org.springframework.lang.Nullable; +import org.springframework.test.context.ContextConfiguration; + +import reactor.test.StepVerifier; + +/** + * Testing the reactive querying using SQL syntax. + * + * @author Youssef Aouichaoui + */ +@SpringIntegrationTest +@ContextConfiguration(classes = { ReactiveSqlOperationsIntegrationTests.Config.class }) +@DisplayName("Using Elasticsearch SQL Reactive Client") +public class ReactiveSqlOperationsIntegrationTests { + @Autowired ReactiveElasticsearchOperations operations; + + @BeforeEach + void setUp() { + // create index + blocking(operations.indexOps(EntityForSQL.class)).createWithMapping(); + + // add data + operations + .saveAll(List.of(EntityForSQL.builder().withViews(3).build(), EntityForSQL.builder().withViews(0).build()), + EntityForSQL.class) + .blockLast(); + } + + @AfterEach + void tearDown() { + // delete index + blocking(operations.indexOps(EntityForSQL.class)).delete(); + } + + // begin configuration region + @Configuration + @Import({ ReactiveElasticsearchTemplateConfiguration.class }) + static class Config {} + // end region + + @Test // #2683 + void when_search_with_an_sql_query() { + // Given + SqlQuery query = SqlQuery.builder("SELECT * FROM entity_for_sql WHERE views = 0").build(); + + // When + + // Then + operations.search(query).as(StepVerifier::create).expectNextCount(1).verifyComplete(); + } + + // begin region + @Document(indexName = "entity_for_sql") + static class EntityForSQL { + @Id private String id; + private final Integer views; + + public EntityForSQL(EntityForSQL.Builder builder) { + this.views = builder.views; + } + + @Nullable + public String getId() { + return id; + } + + public Integer getViews() { + return views; + } + + public static EntityForSQL.Builder builder() { + return new EntityForSQL.Builder(); + } + + static class Builder { + private Integer views = 0; + + public EntityForSQL.Builder withViews(Integer views) { + this.views = views; + + return this; + } + + public EntityForSQL build() { + return new EntityForSQL(this); + } + } + } + // end region +} diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java new file mode 100644 index 000000000..5367d00c0 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java @@ -0,0 +1,143 @@ +/* + * Copyright 2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.core.sql; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.IndexOperations; +import org.springframework.data.elasticsearch.core.query.SqlQuery; +import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration; +import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; +import org.springframework.lang.Nullable; +import org.springframework.test.context.ContextConfiguration; + +/** + * Testing the querying using SQL syntax. + * + * @author Youssef Aouichaoui + */ +@SpringIntegrationTest +@ContextConfiguration(classes = { SqlOperationsIntegrationTests.Config.class }) +@DisplayName("Using Elasticsearch SQL Client") +class SqlOperationsIntegrationTests { + @Autowired ElasticsearchOperations operations; + @Nullable IndexOperations indexOps; + + @BeforeEach + void setUp() { + // create index + indexOps = operations.indexOps(EntityForSQL.class); + indexOps.createWithMapping(); + + // add data + operations.save(EntityForSQL.builder().withViews(3).build(), EntityForSQL.builder().withViews(0).build()); + } + + @AfterEach + void tearDown() { + // delete index + if (indexOps != null) { + indexOps.delete(); + } + } + + // begin configuration region + @Configuration + @Import({ ElasticsearchTemplateConfiguration.class }) + static class Config {} + // end region + + @Test // #2683 + void when_search_with_an_sql_query() { + // Given + SqlQuery query = SqlQuery.builder("SELECT * FROM entity_for_sql WHERE views = 0").build(); + + // When + + // Then + SqlResponse response = operations.search(query); + assertNotNull(response); + assertFalse(response.getRows().isEmpty()); + assertEquals(1, response.getRows().size()); + } + + @Test // #2683 + void when_search_with_an_sql_query_that_has_aggregated_column() { + // Given + SqlQuery query = SqlQuery.builder("SELECT SUM(views) AS TOTAL FROM entity_for_sql").build(); + + // When + + // Then + SqlResponse response = operations.search(query); + assertThat(response.getColumns()).first().extracting(SqlResponse.Column::name).isEqualTo("TOTAL"); + assertThat(response.getRows()).hasSize(1).first().extracting(row -> row.get(response.getColumns().get(0))) + .hasToString("3"); + } + + // begin region + @Document(indexName = "entity_for_sql") + static class EntityForSQL { + @Id private String id; + private final Integer views; + + public EntityForSQL(Builder builder) { + this.views = builder.views; + } + + @Nullable + public String getId() { + return id; + } + + public Integer getViews() { + return views; + } + + public static Builder builder() { + return new Builder(); + } + + static class Builder { + private Integer views = 0; + + public Builder withViews(Integer views) { + this.views = views; + + return this; + } + + public EntityForSQL build() { + return new EntityForSQL(this); + } + } + } + // end region + +} From dbf932cb20771c529d4c90ec4ff946e454be644c Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 6 Aug 2024 20:39:02 +0200 Subject: [PATCH 031/131] Polishing --- .../elasticsearch/elasticsearch-new.adoc | 3 +- .../elc/ReactiveElasticsearchSqlClient.java | 10 ++-- .../elc/ReactiveElasticsearchTemplate.java | 12 +---- .../client/elc/ResponseConverter.java | 54 ++++++++----------- .../elasticsearch/core/sql/SqlResponse.java | 6 +-- ...ReactiveSqlOperationsIntegrationTests.java | 6 +-- .../sql/SqlOperationsIntegrationTests.java | 6 +-- 7 files changed, 38 insertions(+), 59 deletions(-) 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 fe0d86575..57d29dd54 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -5,7 +5,8 @@ == New in Spring Data Elasticsearch 5.4 * Upgrade to Elasticsearch 8.14.3. -* Allow to customize the mapped type name for @InnerField and @Field annotations. +* Allow to customize the mapped type name for `@InnerField` and `@Field` annotations. +* Support for Elasticsearch SQL. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java index 442c5c5a9..0f661d594 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java @@ -15,11 +15,6 @@ */ package org.springframework.data.elasticsearch.client.elc; -import java.io.IOException; -import java.util.function.Function; - -import org.jetbrains.annotations.Nullable; - import co.elastic.clients.ApiClient; import co.elastic.clients.elasticsearch._types.ElasticsearchException; import co.elastic.clients.elasticsearch.sql.QueryRequest; @@ -29,6 +24,11 @@ import co.elastic.clients.util.ObjectBuilder; import reactor.core.publisher.Mono; +import java.io.IOException; +import java.util.function.Function; + +import org.jetbrains.annotations.Nullable; + /** * Reactive version of {@link co.elastic.clients.elasticsearch.sql.ElasticsearchSqlClient}. * diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index aa18c0f74..38252231f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -25,8 +25,6 @@ import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.transport.Version; import co.elastic.clients.transport.endpoints.BooleanResponse; -import org.springframework.data.elasticsearch.core.query.SqlQuery; -import org.springframework.data.elasticsearch.core.sql.SqlResponse; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.util.function.Tuple2; @@ -59,18 +57,12 @@ import org.springframework.data.elasticsearch.core.document.SearchDocument; import org.springframework.data.elasticsearch.core.document.SearchDocumentResponse; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.data.elasticsearch.core.query.BaseQueryBuilder; -import org.springframework.data.elasticsearch.core.query.BulkOptions; -import org.springframework.data.elasticsearch.core.query.ByQueryResponse; -import org.springframework.data.elasticsearch.core.query.DeleteQuery; -import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; -import org.springframework.data.elasticsearch.core.query.UpdateQuery; +import org.springframework.data.elasticsearch.core.query.*; 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; import org.springframework.util.CollectionUtils; 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 232de0151..be5e7f636 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 @@ -15,9 +15,27 @@ */ package org.springframework.data.elasticsearch.client.elc; -import static org.springframework.data.elasticsearch.client.elc.JsonUtils.toJson; -import static org.springframework.data.elasticsearch.client.elc.TypeUtils.removePrefixFromJson; -import static org.springframework.data.elasticsearch.client.elc.TypeUtils.typeMapping; +import static org.springframework.data.elasticsearch.client.elc.JsonUtils.*; +import static org.springframework.data.elasticsearch.client.elc.TypeUtils.*; + +import co.elastic.clients.elasticsearch._types.BulkIndexByScrollFailure; +import co.elastic.clients.elasticsearch._types.ErrorCause; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch.cluster.ComponentTemplateSummary; +import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateResponse; +import co.elastic.clients.elasticsearch.cluster.HealthResponse; +import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; +import co.elastic.clients.elasticsearch.core.GetScriptResponse; +import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; +import co.elastic.clients.elasticsearch.core.mget.MultiGetError; +import co.elastic.clients.elasticsearch.core.mget.MultiGetResponseItem; +import co.elastic.clients.elasticsearch.indices.*; +import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; +import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; +import co.elastic.clients.elasticsearch.sql.QueryResponse; +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonpMapper; import java.util.ArrayList; import java.util.HashMap; @@ -50,36 +68,6 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; -import co.elastic.clients.elasticsearch._types.BulkIndexByScrollFailure; -import co.elastic.clients.elasticsearch._types.ErrorCause; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch._types.query_dsl.Query; -import co.elastic.clients.elasticsearch.cluster.ComponentTemplateSummary; -import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateResponse; -import co.elastic.clients.elasticsearch.cluster.HealthResponse; -import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; -import co.elastic.clients.elasticsearch.core.GetScriptResponse; -import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; -import co.elastic.clients.elasticsearch.core.mget.MultiGetError; -import co.elastic.clients.elasticsearch.core.mget.MultiGetResponseItem; -import co.elastic.clients.elasticsearch.indices.Alias; -import co.elastic.clients.elasticsearch.indices.AliasDefinition; -import co.elastic.clients.elasticsearch.indices.GetAliasResponse; -import co.elastic.clients.elasticsearch.indices.GetIndexResponse; -import co.elastic.clients.elasticsearch.indices.GetIndexTemplateResponse; -import co.elastic.clients.elasticsearch.indices.GetIndicesSettingsResponse; -import co.elastic.clients.elasticsearch.indices.GetMappingResponse; -import co.elastic.clients.elasticsearch.indices.GetTemplateResponse; -import co.elastic.clients.elasticsearch.indices.IndexSettings; -import co.elastic.clients.elasticsearch.indices.IndexState; -import co.elastic.clients.elasticsearch.indices.IndexTemplateSummary; -import co.elastic.clients.elasticsearch.indices.TemplateMapping; -import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; -import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; -import co.elastic.clients.elasticsearch.sql.QueryResponse; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpMapper; - /** * Class to convert Elasticsearch responses into Spring Data Elasticsearch classes. * diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java index 4436c419a..e0a91c437 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java @@ -15,7 +15,9 @@ */ package org.springframework.data.elasticsearch.core.sql; -import static java.util.Collections.unmodifiableList; +import static java.util.Collections.*; + +import jakarta.json.JsonValue; import java.util.ArrayList; import java.util.HashMap; @@ -26,8 +28,6 @@ import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; -import jakarta.json.JsonValue; - /** * Defines an SQL response. * diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java index 8836894d5..62a872ac8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java @@ -15,7 +15,9 @@ */ package org.springframework.data.elasticsearch.core.sql; -import static org.springframework.data.elasticsearch.core.IndexOperationsAdapter.blocking; +import static org.springframework.data.elasticsearch.core.IndexOperationsAdapter.*; + +import reactor.test.StepVerifier; import java.util.List; @@ -35,8 +37,6 @@ import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; -import reactor.test.StepVerifier; - /** * Testing the reactive querying using SQL syntax. * diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java index 5367d00c0..2451b1f43 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java @@ -15,10 +15,8 @@ */ package org.springframework.data.elasticsearch.core.sql; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.assertj.core.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; From 7a7145e5b16ef8b62fa4a79050a33c246187e0b0 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 8 Aug 2024 10:20:12 +0200 Subject: [PATCH 032/131] Update CI properties. See #2914 --- ci/pipeline.properties | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 824563a21..40bb34919 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -1,6 +1,6 @@ # Java versions -java.main.tag=17.0.9_9-jdk-focal -java.next.tag=21.0.1_12-jdk-jammy +java.main.tag=17.0.12_7-jdk-focal +java.next.tag=22.0.2_9-jdk-jammy # Docker container images - standard docker.java.main.image=library/eclipse-temurin:${java.main.tag} @@ -31,6 +31,5 @@ docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c artifactory.url=https://repo.spring.io artifactory.repository.snapshot=libs-snapshot-local -develocity.cache.credentials=gradle_enterprise_cache_user develocity.access-key=gradle_enterprise_secret_access_key jenkins.user.name=spring-builds+jenkins From d079a59cb4568a206764f522bb3fd4ca44af59c5 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 8 Aug 2024 10:22:09 +0200 Subject: [PATCH 033/131] Upgrade to Maven Wrapper 3.9.8. See #2958 --- .mvn/wrapper/maven-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index e6686c6c0..8f451732e 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,3 +1,3 @@ -#Thu Dec 14 08:40:44 CET 2023 +#Thu Aug 08 10:22:09 CEST 2024 wrapperUrl=https\://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar -distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip From 9149c1bc2eda648664f8e87894f364294db4adbd Mon Sep 17 00:00:00 2001 From: Aouichaoui Youssef <21143371+youssef3wi@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:06:56 +0200 Subject: [PATCH 034/131] Allow for `null` and `empty` parameters in the MultiField annotation. Original Pull Request #2960 Closes #2952 --- ...SimpleElasticsearchPersistentProperty.java | 7 +- .../NestedObjectIntegrationTests.java | 76 +++++++++++++++++++ .../core/index/MappingBuilderUnitTests.java | 41 ++++++++++ .../ReactiveMappingBuilderUnitTests.java | 47 ++++++++++++ 4 files changed, 169 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java index 8ba4bffcc..8b32842b9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java @@ -98,6 +98,7 @@ public SimpleElasticsearchPersistentProperty(Property property, this.isSeqNoPrimaryTerm = SeqNoPrimaryTerm.class.isAssignableFrom(getRawType()); boolean isField = isAnnotationPresent(Field.class); + boolean isMultiField = isAnnotationPresent(MultiField.class); if (isVersionProperty() && !getType().equals(Long.class)) { throw new MappingException(String.format("Version property %s must be of type Long!", property.getName())); @@ -109,8 +110,10 @@ public SimpleElasticsearchPersistentProperty(Property property, initPropertyValueConverter(); - storeNullValue = isField && getRequiredAnnotation(Field.class).storeNullValue(); - storeEmptyValue = isField ? getRequiredAnnotation(Field.class).storeEmptyValue() : true; + storeNullValue = isField ? getRequiredAnnotation(Field.class).storeNullValue() + : isMultiField && getRequiredAnnotation(MultiField.class).mainField().storeNullValue(); + storeEmptyValue = isField ? getRequiredAnnotation(Field.class).storeEmptyValue() + : !isMultiField || getRequiredAnnotation(MultiField.class).mainField().storeEmptyValue(); } @Override diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java index 85b9c8a65..1815172ef 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java @@ -15,6 +15,8 @@ */ package org.springframework.data.elasticsearch; +import static co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders.match; +import static java.util.UUID.randomUUID; import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.utils.IdGenerator.*; @@ -28,6 +30,7 @@ import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -37,6 +40,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.InnerField; import org.springframework.data.elasticsearch.annotations.MultiField; +import org.springframework.data.elasticsearch.client.elc.NativeQuery; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.IndexOperations; import org.springframework.data.elasticsearch.core.SearchHits; @@ -373,6 +377,42 @@ public void shouldIndexAndSearchMapAsNestedType() { assertThat(books.getSearchHit(0).getContent().getId()).isEqualTo(book2.getId()); } + @Test // #2952 + @DisplayName("should handle null and empty field parameters in the mapping process") + void shouldSupportMappingNullAndEmptyFieldParameter() { + // Given + operations.indexOps(MultiFieldWithNullEmptyParameters.class).createWithMapping(); + List indexQueries = new ArrayList<>(); + MultiFieldWithNullEmptyParameters nullObj = new MultiFieldWithNullEmptyParameters(); + nullObj.addFieldWithInner(randomUUID().toString()); + MultiFieldWithNullEmptyParameters objWithValue = new MultiFieldWithNullEmptyParameters(); + objWithValue.addEmptyField(randomUUID().toString()); + + IndexQuery indexQuery1 = new IndexQuery(); + indexQuery1.setId(nextIdAsString()); + indexQuery1.setObject(nullObj); + indexQueries.add(indexQuery1); + + IndexQuery indexQuery2 = new IndexQuery(); + indexQuery2.setId(nextIdAsString()); + indexQuery2.setObject(objWithValue); + indexQueries.add(indexQuery2); + + // When + operations.bulkIndex(indexQueries, MultiFieldWithNullEmptyParameters.class); + + // Then + SearchHits nullResults = operations.search( + NativeQuery.builder().withQuery(match(bm -> bm.field("empty-field").query("EMPTY"))).build(), + MultiFieldWithNullEmptyParameters.class); + assertThat(nullResults.getSearchHits()).hasSize(1); + + nullResults = operations.search( + NativeQuery.builder().withQuery(match(bm -> bm.field("inner-field.prefix").query("EMPTY"))).build(), + MultiFieldWithNullEmptyParameters.class); + assertThat(nullResults.getSearchHits()).hasSize(1); + } + @NotNull abstract protected Query getNestedQuery4(); @@ -622,4 +662,40 @@ public void setName(@Nullable String name) { } } + @Document(indexName = "#{@indexNameProvider.indexName()}-multi-field") + static class MultiFieldWithNullEmptyParameters { + @Nullable + @MultiField(mainField = @Field(name = "empty-field", type = FieldType.Keyword, nullValue = "EMPTY", + storeNullValue = true)) private List emptyField; + + @Nullable + @MultiField(mainField = @Field(name = "inner-field", type = FieldType.Text, storeNullValue = true), + otherFields = { @InnerField(suffix = "prefix", type = FieldType.Keyword, + nullValue = "EMPTY") }) private List fieldWithInner; + + public List getEmptyField() { + if (emptyField == null) { + emptyField = new ArrayList<>(); + } + + return emptyField; + } + + public void addEmptyField(String value) { + getEmptyField().add(value); + } + + public List getFieldWithInner() { + if (fieldWithInner == null) { + fieldWithInner = new ArrayList<>(); + } + + return fieldWithInner; + } + + public void addFieldWithInner(@Nullable String value) { + getFieldWithInner().add(value); + } + } + } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index 2335d2c61..eb6f96b08 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -1296,6 +1296,38 @@ void shouldUseCustomMappedNameMultiField() throws JSONException { assertEquals(expected, mapping, true); } + @Test // #2952 + void shouldMapNullityParameters() throws JSONException { + // Given + String expected = """ + { + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "empty-field": { + "type": "keyword", + "null_value": "EMPTY", + "fields": { + "suffix": { + "type": "keyword", + "null_value": "EMPTY_TEXT" + } + } + } + } + } + """; + + // When + String result = getMappingBuilder().buildPropertyMapping(MultiFieldWithNullEmptyParameters.class); + + // Then + assertEquals(expected, result, true); + } + // region entities @Document(indexName = "ignore-above-index") @@ -2570,5 +2602,14 @@ private static class MultiFieldMappedNameEntity { @MultiField(mainField = @Field(type = FieldType.Text, mappedTypeName = "match_only_text"), otherFields = { @InnerField(suffix = "lower_case", type = FieldType.Keyword, normalizer = "lower_case_normalizer", mappedTypeName = "constant_keyword") }) private String description; } + + @SuppressWarnings("unused") + private static class MultiFieldWithNullEmptyParameters { + @Nullable + @MultiField( + mainField = @Field(name = "empty-field", type = FieldType.Keyword, nullValue = "EMPTY", storeNullValue = true), + otherFields = { + @InnerField(suffix = "suffix", type = Keyword, nullValue = "EMPTY_TEXT") }) private List emptyField; + } // endregion } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java index e7a193b03..82e250395 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java @@ -18,10 +18,14 @@ import static org.skyscreamer.jsonassert.JSONAssert.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.InnerField; +import org.springframework.data.elasticsearch.annotations.MultiField; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; import java.time.Instant; +import java.util.List; import org.json.JSONException; import org.junit.jupiter.api.DisplayName; @@ -78,6 +82,40 @@ void shouldWriteRuntimeFields() throws JSONException { assertEquals(expected, mapping, true); } + + @Test // #2952 + void shouldMapNullityParameters() throws JSONException { + // Given + ReactiveMappingBuilder mappingBuilder = getReactiveMappingBuilder(); + String expected = """ + { + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "empty-field": { + "type": "keyword", + "null_value": "EMPTY", + "fields": { + "suffix": { + "type": "keyword", + "null_value": "EMPTY_TEXT" + } + } + } + } + } + """; + + // When + String result = Mono.defer(() -> mappingBuilder.buildReactivePropertyMapping(MultiFieldWithNullEmptyParameters.class)) + .subscribeOn(Schedulers.parallel()).block(); + + // Then + assertEquals(expected, result, true); + } // region entities @Document(indexName = "runtime-fields") @@ -88,5 +126,14 @@ private static class RuntimeFieldEntity { @Field(type = Date, format = DateFormat.epoch_millis, name = "@timestamp") @Nullable private Instant timestamp; } + + @SuppressWarnings("unused") + private static class MultiFieldWithNullEmptyParameters { + @Nullable + @MultiField( + mainField = @Field(name = "empty-field", type = FieldType.Keyword, nullValue = "EMPTY", storeNullValue = true), + otherFields = { + @InnerField(suffix = "suffix", type = Keyword, nullValue = "EMPTY_TEXT") }) private List emptyField; + } // endregion } From 6ad98bf5000b6d1cd585ed0c9bad5ce4dc223927 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Mon, 19 Aug 2024 20:14:13 +0200 Subject: [PATCH 035/131] Polishing --- .../data/elasticsearch/annotations/Field.java | 4 ++++ .../elasticsearch/NestedObjectIntegrationTests.java | 4 ++-- .../core/index/ReactiveMappingBuilderUnitTests.java | 13 +++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index a3a55e650..0a9d4f463 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -130,6 +130,10 @@ boolean norms() default true; /** + * NOte that null_value setting are not supported in Elasticsearch for all types. For example setting a null_value on + * a field with type text will throw an exception in the server when the mapping is written to Elasticsearch. Alas, + * the Elasticsearch documentation does not specify on which types it is allowed on which it is not. + * * @since 4.0 */ String nullValue() default ""; diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java index 1815172ef..433550a5d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch; -import static co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders.match; -import static java.util.UUID.randomUUID; +import static co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders.*; +import static java.util.UUID.*; import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.utils.IdGenerator.*; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java index 82e250395..be677119c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java @@ -18,9 +18,6 @@ import static org.skyscreamer.jsonassert.JSONAssert.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; -import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.data.elasticsearch.annotations.InnerField; -import org.springframework.data.elasticsearch.annotations.MultiField; import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; @@ -34,7 +31,10 @@ import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.InnerField; import org.springframework.data.elasticsearch.annotations.Mapping; +import org.springframework.data.elasticsearch.annotations.MultiField; import org.springframework.data.elasticsearch.core.MappingContextBaseTests; import org.springframework.lang.Nullable; @@ -82,7 +82,7 @@ void shouldWriteRuntimeFields() throws JSONException { assertEquals(expected, mapping, true); } - + @Test // #2952 void shouldMapNullityParameters() throws JSONException { // Given @@ -108,9 +108,10 @@ void shouldMapNullityParameters() throws JSONException { } } """; - + // When - String result = Mono.defer(() -> mappingBuilder.buildReactivePropertyMapping(MultiFieldWithNullEmptyParameters.class)) + String result = Mono + .defer(() -> mappingBuilder.buildReactivePropertyMapping(MultiFieldWithNullEmptyParameters.class)) .subscribeOn(Schedulers.parallel()).block(); // Then From 81eb1679815648a5f69016c4c831bb090b976bfb Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 30 Aug 2024 21:31:07 +0200 Subject: [PATCH 036/131] Upgrade to Elasticsearch 8.15.0. Ortiginal Pull Request #2974 Closes #2963 --- pom.xml | 2 +- .../elasticsearch/elasticsearch-new.adoc | 2 +- .../ROOT/pages/elasticsearch/versions.adoc | 2 +- .../client/elc/CriteriaQueryProcessor.java | 73 +++++++++--------- .../elc/ReactiveElasticsearchClient.java | 8 +- .../client/elc/RequestConverter.java | 68 +++++++---------- .../core/mapping/IndexCoordinates.java | 2 +- .../ElasticsearchELCIntegrationTests.java | 74 +++++++++---------- .../core/IndexCoordinatesUnitTests.java | 3 +- .../core/LogEntityELCIntegrationTests.java | 15 ++-- .../testcontainers-elasticsearch.properties | 2 +- 11 files changed, 122 insertions(+), 129 deletions(-) diff --git a/pom.xml b/pom.xml index afec49ecf..8a7694c1a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.14.3 + 8.15.0 1.0.9.RELEASE 0.19.0 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 57d29dd54..b7bca8abd 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-4-0]] == New in Spring Data Elasticsearch 5.4 -* Upgrade to Elasticsearch 8.14.3. +* Upgrade to Elasticsearch 8.15.0. * Allow to customize the mapped type name for `@InnerField` and `@Field` annotations. * Support for Elasticsearch SQL. diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 319167f29..7deac45f9 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 -| 2024.1 (in development) | 5.3.x | 8.14.3 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.15.0 | 6.1.x | 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java index 435ba9a70..b5788ba72 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java @@ -127,7 +127,7 @@ public static Query createQuery(Criteria criteria) { mustQueries.add(Query.of(qb -> qb.matchAll(m -> m))); } - return new Query.Builder().bool(boolQueryBuilder -> { + return new Query.Builder().bool(boolQueryBuilder -> { if (!shouldQueries.isEmpty()) { boolQueryBuilder.should(shouldQueries); @@ -249,49 +249,54 @@ private static Query.Builder queryFor(Criteria.CriteriaEntry entry, Field field, queryBuilder.queryString(queryStringQuery(fieldName, Objects.requireNonNull(value).toString(), boost)); break; case LESS: - queryBuilder // - .range(rb -> rb // - .field(fieldName) // - .lt(JsonData.of(value)) // - .boost(boost)); // + queryBuilder + .range(rb -> rb + .untyped(ut -> ut + .field(fieldName) + .lt(JsonData.of(value)) + .boost(boost))); break; case LESS_EQUAL: - queryBuilder // - .range(rb -> rb // - .field(fieldName) // - .lte(JsonData.of(value)) // - .boost(boost)); // + queryBuilder + .range(rb -> rb + .untyped(ut -> ut + .field(fieldName) + .lte(JsonData.of(value)) + .boost(boost))); break; case GREATER: - queryBuilder // - .range(rb -> rb // - .field(fieldName) // - .gt(JsonData.of(value)) // - .boost(boost)); // + queryBuilder + .range(rb -> rb + .untyped(ut -> ut + .field(fieldName) + .gt(JsonData.of(value)) + .boost(boost))); break; case GREATER_EQUAL: - queryBuilder // - .range(rb -> rb // - .field(fieldName) // - .gte(JsonData.of(value)) // - .boost(boost)); // + queryBuilder + .range(rb -> rb + .untyped(ut -> ut + .field(fieldName) + .gte(JsonData.of(value)) + .boost(boost))); break; case BETWEEN: Object[] ranges = (Object[]) value; Assert.notNull(value, "value for a between condition must not be null"); - queryBuilder // - .range(rb -> { - rb.field(fieldName); - if (ranges[0] != null) { - rb.gte(JsonData.of(ranges[0])); - } - - if (ranges[1] != null) { - rb.lte(JsonData.of(ranges[1])); - } - rb.boost(boost); // - return rb; - }); // + queryBuilder + .range(rb -> rb + .untyped(ut -> { + ut.field(fieldName); + if (ranges[0] != null) { + ut.gte(JsonData.of(ranges[0])); + } + + if (ranges[1] != null) { + ut.lte(JsonData.of(ranges[1])); + } + ut.boost(boost); // + return ut; + })); break; case FUZZY: diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index 040625a12..50bc8036f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -126,7 +126,7 @@ public Mono> get(GetRequest request, Class tClass) { // java.lang.Class) // noinspection unchecked JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.get.TDocument", + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tClass)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, transportOptions)); @@ -145,7 +145,7 @@ public Mono> update(UpdateRequest request, Class< // noinspection unchecked JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = new EndpointWithResponseMapperAttr( - UpdateRequest._ENDPOINT, "co.elastic.clients:Deserializer:_global.update.TDocument", + UpdateRequest._ENDPOINT, "co.elastic.clients:Deserializer:_global.update.Response.TDocument", this.getDeserializer(clazz)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, this.transportOptions)); } @@ -171,7 +171,7 @@ public Mono> mget(MgetRequest request, Class clazz) { // noinspection unchecked JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.mget.TDocument", + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", this.getDeserializer(clazz)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, transportOptions)); @@ -282,7 +282,7 @@ public Mono> scroll(ScrollRequest request, Class tDocum // noinspection unchecked JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentClass)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, transportOptions)); } 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 6c3836701..9dd037db3 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 @@ -20,7 +20,6 @@ import co.elastic.clients.elasticsearch._types.Conflicts; import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.InlineScript; import co.elastic.clients.elasticsearch._types.NestedSortValue; import co.elastic.clients.elasticsearch._types.OpType; import co.elastic.clients.elasticsearch._types.SortOptions; @@ -744,16 +743,12 @@ private co.elastic.clients.elasticsearch._types.Script getScript(@Nullable Scrip scriptData.params().forEach((key, value) -> params.put(key, JsonData.of(value, jsonpMapper))); } return co.elastic.clients.elasticsearch._types.Script.of(sb -> { + sb.lang(scriptData.language()) + .params(params); if (scriptData.type() == ScriptType.INLINE) { - sb.inline(is -> is // - .lang(scriptData.language()) // - .source(scriptData.script()) // - .params(params)); // + sb.source(scriptData.script()); } else if (scriptData.type() == ScriptType.STORED) { - sb.stored(ss -> ss // - .id(scriptData.script()) // - .params(params) // - ); + sb.id(scriptData.script()); } return sb; }); @@ -925,7 +920,9 @@ public co.elastic.clients.elasticsearch.core.ReindexRequest reindex(ReindexReque ReindexRequest.Script script = reindexRequest.getScript(); if (script != null) { - builder.script(s -> s.inline(InlineScript.of(i -> i.lang(script.getLang()).source(script.getSource())))); + builder.script(sb -> sb + .lang(script.getLang()) + .source(script.getSource())); } builder.timeout(time(reindexRequest.getTimeout())) // @@ -1078,21 +1075,15 @@ public DeleteByQueryRequest documentDeleteByQueryRequest(DeleteQuery query, @Nul } uqb.script(sb -> { + sb.lang(query.getLang()).params(params); + if (query.getScriptType() == ScriptType.INLINE) { - sb.inline(is -> is // - .lang(query.getLang()) // - .source(query.getScript()) // - .params(params)); // + sb.source(query.getScript()); // } else if (query.getScriptType() == ScriptType.STORED) { - sb.stored(ss -> ss // - .id(query.getScript()) // - .params(params) // - ); + sb.id(query.getScript()); } return sb; - } - - ); + }); } uqb // @@ -1347,17 +1338,16 @@ public MsearchRequest searchMsearchRequest( String script = runtimeField.getScript(); if (script != null) { - rfb - .script(s -> s - .inline(is -> { - is.source(script); - - if (runtimeField.getParams() != null) { - is.params(TypeUtils.paramsMap(runtimeField.getParams())); - } - return is; - })); + rfb.script(s -> { + s.source(script); + + if (runtimeField.getParams() != null) { + s.params(TypeUtils.paramsMap(runtimeField.getParams())); + } + return s; + }); } + return rfb; }); runtimeMappings.put(runtimeField.getName(), esRuntimeField); @@ -1548,16 +1538,14 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu rfb.type(RuntimeFieldType._DESERIALIZER.parse(runtimeField.getType())); String script = runtimeField.getScript(); if (script != null) { - rfb - .script(s -> s - .inline(is -> { - is.source(script); + rfb.script(s -> { + s.source(script); - if (runtimeField.getParams() != null) { - is.params(TypeUtils.paramsMap(runtimeField.getParams())); - } - return is; - })); + if (runtimeField.getParams() != null) { + s.params(TypeUtils.paramsMap(runtimeField.getParams())); + } + return s; + }); } return rfb; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java index a6783cba2..e93d9d704 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java @@ -34,12 +34,12 @@ public class IndexCoordinates { private final String[] indexNames; public static IndexCoordinates of(String... indexNames) { - Assert.notNull(indexNames, "indexNames must not be null"); return new IndexCoordinates(indexNames); } private IndexCoordinates(String... indexNames) { Assert.notEmpty(indexNames, "indexNames may not be null or empty"); + Assert.noNullElements(indexNames, "indexNames may not contain null elements"); this.indexNames = indexNames; } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java index 5686cf69d..09c775569 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java @@ -190,44 +190,42 @@ protected Query getMatchAllQueryWithIncludesAndInlineExpressionScript(@Nullable @Override protected Query getQueryWithRescorer() { - return NativeQuery.builder() // - .withQuery(q -> q // - .bool(b -> b // - .filter(f -> f.exists(e -> e.field("rate"))) // - .should(s -> s.term(t -> t.field("message").value("message"))) // - )) // - .withRescorerQuery( // - new RescorerQuery(NativeQuery.builder() // - .withQuery(q -> q // - .functionScore(fs -> fs // - .functions(f1 -> f1 // - .filter(matchAllQueryAsQuery()) // - .weight(1.0) // - .gauss(d -> d // - .field("rate") // - .placement(dp -> dp // - .origin(JsonData.of(0)) // - .scale(JsonData.of(10)) // - .decay(0.5)) // - )) // - .functions(f2 -> f2 // - .filter(matchAllQueryAsQuery()).weight(100.0) // - .gauss(d -> d // - .field("rate") // - .placement(dp -> dp // - .origin(JsonData.of(0)) // - .scale(JsonData.of(10)) // - .decay(0.5)) // - - )) // - .scoreMode(FunctionScoreMode.Sum) // - .maxBoost(80.0) // - .boostMode(FunctionBoostMode.Replace)) // - ) // - .build() // - ) // - .withScoreMode(RescorerQuery.ScoreMode.Max) // - .withWindowSize(100)) // + return NativeQuery.builder() + .withQuery(q -> q + .bool(b -> b + .filter(f -> f.exists(e -> e.field("rate"))) + .should(s -> s.term(t -> t.field("message").value("message"))))) + .withRescorerQuery( + new RescorerQuery(NativeQuery.builder() + .withQuery(q -> q + .functionScore(fs -> fs + .functions(f1 -> f1 + .filter(matchAllQueryAsQuery()) + .weight(1.0) + .gauss(d -> d + .untyped(ut -> ut + .field("rate") + .placement(dp -> dp + .origin(JsonData.of(0)) + .scale(JsonData.of(10)) + .decay(0.5))))) + .functions(f2 -> f2 + .filter(matchAllQueryAsQuery()).weight(100.0) + .gauss(d -> d + .untyped(ut -> ut + .field("rate") + .placement(dp -> dp + .origin(JsonData.of(0)) + .scale(JsonData.of(10)) + .decay(0.5))) + + )) + .scoreMode(FunctionScoreMode.Sum) + .maxBoost(80.0) + .boostMode(FunctionBoostMode.Replace))) + .build()) + .withScoreMode(RescorerQuery.ScoreMode.Max) + .withWindowSize(100)) .build(); } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java index d16ce907b..36a98577e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java @@ -23,11 +23,12 @@ /** * @author Peter-Josef Meisch */ +@SuppressWarnings("DataFlowIssue") class IndexCoordinatesUnitTests { @Test void cannotBeInitializedWithNullIndexName() { - assertThatThrownBy(() -> IndexCoordinates.of(null)).isInstanceOf(IllegalArgumentException.class); + assertThatThrownBy(() -> IndexCoordinates.of((String) null)).isInstanceOf(IllegalArgumentException.class); } @Test diff --git a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java index 186cf39da..12c857ccb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java @@ -54,12 +54,13 @@ Query termQueryForIp(String ip) { @Override Query rangeQueryForIp(String from, String to) { - return NativeQuery.builder() // - .withQuery(qb -> qb // - .range(rqb -> rqb // - .field("ip") // - .gte(JsonData.of(from))// - .lte(JsonData.of(to))// - )).build(); + return NativeQuery.builder() + .withQuery(qb -> qb + .range(rqb -> rqb + .untyped(ut -> ut + .field("ip") + .gte(JsonData.of(from)) + .lte(JsonData.of(to))))) + .build(); } } diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 92363da11..d03727107 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.14.3 +sde.testcontainers.image-version=8.15.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 From 555b5702467a904ecd40bac486d3ba4bdb71a744 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 31 Aug 2024 21:18:35 +0200 Subject: [PATCH 037/131] Add excludeFromSource handling to multifield. Original Pull Request #2975 Closes #2971 --- .../core/index/MappingBuilder.java | 10 +- .../core/index/MappingBuilderUnitTests.java | 93 +++++++++++-------- 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java index 97bbc186b..f37b047f1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java @@ -349,8 +349,10 @@ private void buildPropertyMapping(ObjectNode propertiesNode, boolean isRootObjec : nestedPropertyPrefix + '.' + property.getFieldName(); Field fieldAnnotation = property.findAnnotation(Field.class); + MultiField multiFieldAnnotation = property.findAnnotation(MultiField.class); - if (fieldAnnotation != null && fieldAnnotation.excludeFromSource()) { + if ((fieldAnnotation != null && fieldAnnotation.excludeFromSource()) || + multiFieldAnnotation != null && multiFieldAnnotation.mainField().excludeFromSource()) { excludeFromSource.add(nestedPropertyPath); } @@ -381,8 +383,6 @@ private void buildPropertyMapping(ObjectNode propertiesNode, boolean isRootObjec } } - MultiField multiField = property.findAnnotation(MultiField.class); - if (isCompletionProperty) { CompletionField completionField = property.findAnnotation(CompletionField.class); applyCompletionFieldMapping(propertiesNode, property, completionField); @@ -390,8 +390,8 @@ private void buildPropertyMapping(ObjectNode propertiesNode, boolean isRootObjec if (isRootObject && fieldAnnotation != null && property.isIdProperty()) { applyDefaultIdFieldMapping(propertiesNode, property); - } else if (multiField != null) { - addMultiFieldMapping(propertiesNode, property, multiField, isNestedOrObjectProperty, dynamicMapping); + } else if (multiFieldAnnotation != null) { + addMultiFieldMapping(propertiesNode, property, multiFieldAnnotation, isNestedOrObjectProperty, dynamicMapping); } else if (fieldAnnotation != null) { addSingleFieldMapping(propertiesNode, property, fieldAnnotation, isNestedOrObjectProperty, dynamicMapping); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index eb6f96b08..e79472d8f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -1126,38 +1126,49 @@ void shouldAddFieldsThatAreExcludedFromSource() throws JSONException { String expected = """ { - "properties": { - "_class": { - "type": "keyword", - "index": false, - "doc_values": false - }, - "excluded-date": { - "type": "date", - "format": "date" - }, - "nestedEntity": { - "type": "nested", - "properties": { - "_class": { - "type": "keyword", - "index": false, - "doc_values": false - }, - "excluded-text": { - "type": "text" - } - } - } - }, - "_source": { - "excludes": [ - "excluded-date", - "nestedEntity.excluded-text" - ] - } - } - """; // + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "excluded-date": { + "type": "date", + "format": "date" + }, + "nestedEntity": { + "type": "nested", + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "excluded-text": { + "type": "text" + } + } + }, + "excluded-multifield": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + } + }, + "_source": { + "excludes": [ + "excluded-date", + "nestedEntity.excluded-text", + "excluded-multifield" + ] + } + + } + + """; // String mapping = getMappingBuilder().buildPropertyMapping(ExcludedFieldEntity.class); @@ -1243,7 +1254,7 @@ void shouldWriteFieldAliasesToTheMapping() throws JSONException { assertEquals(expected, mapping, true); } - + @Test // #2942 @DisplayName("should use custom mapped name") void shouldUseCustomMappedName() throws JSONException { @@ -2192,8 +2203,7 @@ static class DenseVectorEntityWithKnnSearch { @Nullable @Field(type = FieldType.Dense_Vector, dims = 16, elementType = FieldElementType.FLOAT, knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, efConstruction = 100), - knnSimilarity = KnnSimilarity.DOT_PRODUCT) - private float[] my_vector; + knnSimilarity = KnnSimilarity.DOT_PRODUCT) private float[] my_vector; @Nullable public String getId() { @@ -2269,8 +2279,7 @@ public void setText(@Nullable String text) { static class DenseVectorMisMatchConfidenceIntervalClass { @Field(type = Dense_Vector, dims = 16, elementType = FieldElementType.FLOAT, knnIndexOptions = @KnnIndexOptions(type = KnnAlgorithmType.HNSW, m = 16, confidenceInterval = 0.95F), - knnSimilarity = KnnSimilarity.DOT_PRODUCT) - private float[] dense_vector; + knnSimilarity = KnnSimilarity.DOT_PRODUCT) private float[] dense_vector; } static class DisabledMappingProperty { @@ -2553,6 +2562,10 @@ private static class ExcludedFieldEntity { excludeFromSource = true) private LocalDate excludedDate; @Nullable @Field(type = Nested) private NestedExcludedFieldEntity nestedEntity; + @Nullable + @MultiField(mainField = @Field(name = "excluded-multifield", type = Text, excludeFromSource = true), otherFields = { + @InnerField(suffix = "keyword", type = Keyword) + }) private String excludedMultifield; } @SuppressWarnings("unused") @@ -2599,8 +2612,10 @@ private static class FieldMappedNameEntity { @SuppressWarnings("unused") private static class MultiFieldMappedNameEntity { @Nullable - @MultiField(mainField = @Field(type = FieldType.Text, mappedTypeName = "match_only_text"), otherFields = { @InnerField(suffix = "lower_case", - type = FieldType.Keyword, normalizer = "lower_case_normalizer", mappedTypeName = "constant_keyword") }) private String description; + @MultiField(mainField = @Field(type = FieldType.Text, mappedTypeName = "match_only_text"), + otherFields = { @InnerField(suffix = "lower_case", + type = FieldType.Keyword, normalizer = "lower_case_normalizer", + mappedTypeName = "constant_keyword") }) private String description; } @SuppressWarnings("unused") From b1b232d354374d4003a1d640e1aec96bf0a6d687 Mon Sep 17 00:00:00 2001 From: HAN SEUNGWOO Date: Wed, 4 Sep 2024 03:09:26 +0900 Subject: [PATCH 038/131] Set refresh on DeleteByQueryRequest by DeleteQuery. Original Pull Request #2976 Closes #2973 --- .../client/elc/RequestConverter.java | 3 +++ .../client/elc/RequestConverterTest.java | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) 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 9dd037db3..ea42903a5 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 @@ -1045,6 +1045,9 @@ public DeleteByQueryRequest documentDeleteByQueryRequest(DeleteQuery query, @Nul .collect(Collectors.toList())); } } + if (query.getRefresh() != null) { + dqb.refresh(query.getRefresh()); + } dqb.allowNoIndices(query.getAllowNoIndices()) .conflicts(conflicts(query.getConflicts())) .ignoreUnavailable(query.getIgnoreUnavailable()) diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java index 5036f92c9..4f12438cd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java @@ -30,12 +30,16 @@ import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; +import org.springframework.data.elasticsearch.core.query.Criteria; +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.lang.Nullable; /** * @author Peter-Josef Meisch + * @author Han Seungwoo */ class RequestConverterTest { @@ -72,6 +76,19 @@ void shouldAddDocvalueFields() { assertThat(fieldAndFormats.get(1).format()).isEqualTo("format2"); } + @Test // #2973 + @DisplayName("should set refresh based on deleteRequest") + void refreshSetByDeleteRequest() { + var query = new CriteriaQuery(new Criteria("text").contains("test")); + var deleteQuery = DeleteQuery.builder(query).withRefresh(true).build(); + + var deleteByQueryRequest = requestConverter.documentDeleteByQueryRequest(deleteQuery, null, SampleEntity.class, + IndexCoordinates.of("foo"), + null); + + assertThat(deleteByQueryRequest.refresh()).isTrue(); + } + @Document(indexName = "does-not-matter") static class SampleEntity { @Nullable From d06c122fd55e55b8886b1d3a3389516b08066784 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Wed, 4 Sep 2024 18:10:20 +0200 Subject: [PATCH 039/131] Remove Blockhound Original Pull Request #2978 Closes #2977 --- pom.xml | 27 ----------- .../BlockHoundIntegrationCustomizer.java | 48 ------------------- .../blockhound/BlockHoundTests.java | 47 ------------------ ...ockhound.integration.BlockHoundIntegration | 1 - 4 files changed, 123 deletions(-) delete mode 100644 src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java delete mode 100644 src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java delete mode 100644 src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration diff --git a/pom.xml b/pom.xml index 8a7694c1a..210333c13 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,6 @@ 8.15.0 - 1.0.9.RELEASE 0.19.0 2.23.1 1.5.3 @@ -237,13 +236,6 @@ test - - io.projectreactor.tools - blockhound-junit-platform - ${blockhound-junit} - test - - org.skyscreamer jsonassert @@ -432,25 +424,6 @@ - - jdk13+ - - - [13,) - - - - - org.apache.maven.plugins - maven-surefire-plugin - - -XX:+AllowRedefinitionToAddDeleteMethods - - - - - - antora-process-resources diff --git a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java deleted file mode 100644 index 1f79dc622..000000000 --- a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundIntegrationCustomizer.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2021-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.blockhound; - -import reactor.blockhound.BlockHound; -import reactor.blockhound.BlockingOperationError; -import reactor.blockhound.integration.BlockHoundIntegration; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * @author Peter-Josef Meisch - */ -public class BlockHoundIntegrationCustomizer implements BlockHoundIntegration { - - private static final Log LOGGER = LogFactory.getLog(BlockHoundIntegrationCustomizer.class); - - @Override - public void applyTo(BlockHound.Builder builder) { - // Elasticsearch classes reading from the classpath on initialization, needed for parsing Elasticsearch responses - builder // - .allowBlockingCallsInside("org.elasticsearch.Build", "") // - .allowBlockingCallsInside("org.elasticsearch.common.xcontent.XContentBuilder", "") // pre 7.16 - .allowBlockingCallsInside("org.elasticsearch.common.XContentBuilder", "") // from 7.16 on - .allowBlockingCallsInside("org.elasticsearch.xcontent.json.JsonXContent", "contentBuilder") // from 7.16 on - .allowBlockingCallsInside("jakarta.json.spi.JsonProvider", "provider") // - ; - builder.blockingMethodCallback(it -> { - LOGGER.error("BlockHound error", new Error(it.toString())); - throw new BlockingOperationError(it); - }); - - } -} diff --git a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java b/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java deleted file mode 100644 index 2e10327d4..000000000 --- a/src/test/java/org/springframework/data/elasticsearch/blockhound/BlockHoundTests.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2021-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.blockhound; - -import static org.assertj.core.api.Assertions.*; - -import reactor.blockhound.BlockingOperationError; -import reactor.core.publisher.Mono; - -import java.time.Duration; - -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -/** - * @author Peter-Josef Meisch - */ -public class BlockHoundTests { - - @Test // #1822 - @DisplayName("should fail if BlockHound is not installed") - void shouldFailIfBlockHoundIsNotInstalled() { - - assertThatThrownBy(() -> { - Mono.delay(Duration.ofMillis(1)).doOnNext(it -> { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - }).block(); // should throw an exception about Thread.sleep - }).hasCauseInstanceOf(BlockingOperationError.class); - } -} diff --git a/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration b/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration deleted file mode 100644 index 1cd5f8f92..000000000 --- a/src/test/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration +++ /dev/null @@ -1 +0,0 @@ -org.springframework.data.elasticsearch.blockhound.BlockHoundIntegrationCustomizer From aab66c9595ad7eaf01462a19c7fbd898c9c96e16 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 13 Sep 2024 12:39:15 +0200 Subject: [PATCH 040/131] Prepare 5.4 M1 (2024.1.0). See #2914 --- pom.xml | 14 ++------------ src/main/resources/notice.txt | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 210333c13..cc6a5ec85 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0-SNAPSHOT + 3.4.0-M1 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0-SNAPSHOT + 3.4.0-M1 8.15.0 @@ -450,16 +450,6 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - spring-milestone https://repo.spring.io/milestone diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 8cee1fd55..4e4aa4c63 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.3 GA (2024.0.0) +Spring Data Elasticsearch 5.4 M1 (2024.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -22,3 +22,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From b4ab1f28cdfc30379f1b9b17a022ff887afe263a Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 13 Sep 2024 12:39:33 +0200 Subject: [PATCH 041/131] Release version 5.4 M1 (2024.1.0). See #2914 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cc6a5ec85..523034e9b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0-SNAPSHOT + 5.4.0-M1 org.springframework.data.build From 6cb5f92928b810f2fe4010edae2f03ca83f4b764 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 13 Sep 2024 12:42:27 +0200 Subject: [PATCH 042/131] Prepare next development iteration. See #2914 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 523034e9b..cc6a5ec85 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0-M1 + 5.4.0-SNAPSHOT org.springframework.data.build From d55947b81e6b21b560d67197b9e4f84d29f7bb42 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 13 Sep 2024 12:42:28 +0200 Subject: [PATCH 043/131] After release cleanups. See #2914 --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cc6a5ec85..210333c13 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0-M1 + 3.4.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0-M1 + 3.4.0-SNAPSHOT 8.15.0 @@ -450,6 +450,16 @@ + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + spring-milestone https://repo.spring.io/milestone From 98716a871b578ebb82b4428a2d8be29b9c4fd898 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 9 Oct 2024 09:02:07 +0200 Subject: [PATCH 044/131] Consistently run all CI steps with the same user. See #2982 --- Jenkinsfile | 6 ++++-- ci/clean.sh | 2 +- ci/verify.sh | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3978651bd..1d2500ed1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -99,15 +99,17 @@ pipeline { steps { script { docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { - docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { + docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) { sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + - "./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root " + + "./mvnw -s settings.xml -Pci,artifactory " + + "-Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root " + "-Dartifactory.server=${p['artifactory.url']} " + "-Dartifactory.username=${ARTIFACTORY_USR} " + "-Dartifactory.password=${ARTIFACTORY_PSW} " + "-Dartifactory.staging-repository=${p['artifactory.repository.snapshot']} " + "-Dartifactory.build-name=spring-data-elasticsearch " + "-Dartifactory.build-number=spring-data-elasticsearch-${BRANCH_NAME}-build-${BUILD_NUMBER} " + + "-Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch " + "-Dmaven.test.skip=true clean deploy -U -B" } } diff --git a/ci/clean.sh b/ci/clean.sh index 1d5a0b3f6..ca174330e 100755 --- a/ci/clean.sh +++ b/ci/clean.sh @@ -5,4 +5,4 @@ set -euo pipefail export JENKINS_USER=${JENKINS_USER_NAME} MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ - ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch + ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root diff --git a/ci/verify.sh b/ci/verify.sh index 1f34bbd93..46afc8028 100755 --- a/ci/verify.sh +++ b/ci/verify.sh @@ -3,9 +3,8 @@ set -euo pipefail mkdir -p /tmp/jenkins-home/.m2/spring-data-elasticsearch -chown -R 1001:1001 . export JENKINS_USER=${JENKINS_USER_NAME} MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ ./mvnw -s settings.xml \ - -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch + -P${PROFILE} clean dependency:list verify -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root From fe8c2b13b0e63ae1040218ba75c1ee46132efecd Mon Sep 17 00:00:00 2001 From: Maryanto <54889592+maryantocinn@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:13:28 +0700 Subject: [PATCH 045/131] Add count methods to ELC's ReactiveElasticsearchClient. Original Pull Request #2985 Closes #2749 --- .../elc/ReactiveElasticsearchClient.java | 21 ++++++++++ .../elasticsearch/client/elc/DevTests.java | 40 +++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index 50bc8036f..958b1f59f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -36,6 +36,7 @@ * Reactive version of {@link co.elastic.clients.elasticsearch.ElasticsearchClient}. * * @author Peter-Josef Meisch + * @author maryantocinn * @since 4.4 */ public class ReactiveElasticsearchClient extends ApiClient @@ -227,6 +228,26 @@ public Mono deleteByQuery( return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build()); } + /** + * @since 5.4 + */ + public Mono count(CountRequest request) { + + Assert.notNull(request, "request must not be null"); + + return Mono.fromFuture(transport.performRequestAsync(request, CountRequest._ENDPOINT, transportOptions)); + } + + /** + * @since 5.4 + */ + public Mono count(Function> fn) { + + Assert.notNull(fn, "fn must not be null"); + + return count(fn.apply(new CountRequest.Builder()).build()); + } + // endregion // region search diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java index 856d5a3d3..81aabf402 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java @@ -22,6 +22,8 @@ import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; import co.elastic.clients.elasticsearch.cluster.HealthRequest; import co.elastic.clients.elasticsearch.cluster.HealthResponse; +import co.elastic.clients.elasticsearch.core.CountRequest; +import co.elastic.clients.elasticsearch.core.CountResponse; import co.elastic.clients.elasticsearch.core.IndexRequest; import co.elastic.clients.elasticsearch.core.IndexResponse; import co.elastic.clients.elasticsearch.core.SearchRequest; @@ -62,6 +64,7 @@ * on port 9200 and an intercepting proxy on port 8080. * * @author Peter-Josef Meisch + * @author maryantocinn */ @Disabled @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @@ -352,6 +355,43 @@ private ResponseBody searchImperative(SearchRequest searchRequest) private ResponseBody searchReactive(SearchRequest searchRequest) { return Objects.requireNonNull(reactiveElasticsearchClient.search(searchRequest, EntityAsMap.class).block()); } + + // endregion + // region count + @Test + @Order(40) + void count() { + + CountRequest countRequest = new CountRequest.Builder().index(INDEX) + .query(query -> query.match(matchQuery -> matchQuery.field("content").query(FieldValue.of("content1")))) + .build(); + + CountResponse countResponse = null; + + try { + countResponse = countImperative(countRequest); + assertThat(countResponse).isNotNull(); + assertThat(countResponse.count()).isEqualTo(1); + } catch (IOException e) { + LOGGER.error("error", e); + } + + try { + countResponse = countReactive(countRequest); + assertThat(countResponse).isNotNull(); + assertThat(countResponse.count()).isEqualTo(1); + } catch (Exception e) { + LOGGER.error("error", e); + } + } + + private CountResponse countImperative(CountRequest countRequest) throws IOException { + return imperativeElasticsearchClient.count(countRequest); + } + + private CountResponse countReactive(CountRequest countRequest) { + return Objects.requireNonNull(reactiveElasticsearchClient.count(countRequest).block()); + } // endregion private ClientConfiguration clientConfiguration() { From 3157c62198e745d759695af1253e6cc4877ac17b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 18 Oct 2024 12:46:44 +0200 Subject: [PATCH 046/131] Prepare 5.4 RC1 (2024.1.0). See #2982 --- pom.xml | 14 ++------------ src/main/resources/notice.txt | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 210333c13..6ba2b7d4a 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0-SNAPSHOT + 3.4.0-RC1 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0-SNAPSHOT + 3.4.0-RC1 8.15.0 @@ -450,16 +450,6 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - spring-milestone https://repo.spring.io/milestone diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 4e4aa4c63..1b8a6296b 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.4 M1 (2024.1.0) +Spring Data Elasticsearch 5.4 RC1 (2024.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -23,3 +23,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 893c9cbf926f139d6c736343ef873b6d9fc8ddba Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 18 Oct 2024 12:47:01 +0200 Subject: [PATCH 047/131] Release version 5.4 RC1 (2024.1.0). See #2982 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ba2b7d4a..54c203f2f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0-SNAPSHOT + 5.4.0-RC1 org.springframework.data.build From 378dcabe19af67de813ee83104f4cbe11d1bfaf7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 18 Oct 2024 12:49:40 +0200 Subject: [PATCH 048/131] Prepare next development iteration. See #2982 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54c203f2f..6ba2b7d4a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0-RC1 + 5.4.0-SNAPSHOT org.springframework.data.build From 172933af8e9348d957c4953f9df6b852d4c1c12f Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 18 Oct 2024 12:49:41 +0200 Subject: [PATCH 049/131] After release cleanups. See #2982 --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6ba2b7d4a..210333c13 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0-RC1 + 3.4.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0-RC1 + 3.4.0-SNAPSHOT 8.15.0 @@ -450,6 +450,16 @@ + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + spring-milestone https://repo.spring.io/milestone From d2ab03e6a4a1801c950394cdabaee283d21d05c2 Mon Sep 17 00:00:00 2001 From: El-Harrougui MOHAMED Date: Tue, 22 Oct 2024 05:11:57 +0100 Subject: [PATCH 050/131] Add support for retrieving request executionDuration. Original Pull Request #2991 Closes #2986 --- .../ROOT/pages/elasticsearch/template.adoc | 2 +- .../client/elc/DocumentAdapters.java | 3 +- .../elc/SearchDocumentResponseBuilder.java | 16 +++- .../core/ReactiveSearchHits.java | 8 ++ .../core/ReactiveSearchHitsImpl.java | 8 ++ .../elasticsearch/core/SearchHitMapping.java | 8 +- .../data/elasticsearch/core/SearchHits.java | 7 ++ .../elasticsearch/core/SearchHitsImpl.java | 15 +++- .../core/SearchHitsIterator.java | 8 ++ .../elasticsearch/core/StreamQueries.java | 8 ++ .../core/document/SearchDocumentResponse.java | 12 ++- ...earchDocumentResponseBuilderUnitTests.java | 77 ++++++------------- .../core/ElasticsearchIntegrationTests.java | 5 +- .../core/SearchHitSupportTest.java | 11 ++- .../elasticsearch/core/StreamQueriesTest.java | 5 +- 15 files changed, 123 insertions(+), 70 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc index cf458c3b8..d5cbec5d0 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/template.adoc @@ -81,7 +81,7 @@ When a document is retrieved with the methods of the `DocumentOperations` inter When searching with the methods of the `SearchOperations` interface, additional information is available for each entity, for example the _score_ or the _sortValues_ of the found entity. In order to return this information, each entity is wrapped in a `SearchHit` object that contains this entity-specific additional information. -These `SearchHit` objects themselves are returned within a `SearchHits` object which additionally contains informations about the whole search like the _maxScore_ or requested aggregations. +These `SearchHit` objects themselves are returned within a `SearchHits` object which additionally contains informations about the whole search like the _maxScore_ or requested aggregations or the execution duration it took to complete the request. The following classes and interfaces are now available: .SearchHit diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java index 1b2dfadbb..871ad36d3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java @@ -50,6 +50,7 @@ * * @author Peter-Josef Meisch * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.4 */ final class DocumentAdapters { @@ -74,7 +75,7 @@ public static SearchDocument from(Hit hit, JsonpMapper jsonpMapper) { Map innerHits = new LinkedHashMap<>(); hit.innerHits().forEach((name, innerHitsResult) -> { // noinspection ReturnOfNull - innerHits.put(name, SearchDocumentResponseBuilder.from(innerHitsResult.hits(), null, null, null, null, null, + innerHits.put(name, SearchDocumentResponseBuilder.from(innerHitsResult.hits(), null, null, null, 0, null, null, searchDocument -> null, jsonpMapper)); }); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java index 2ced82f2d..b3b0ca7ba 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java @@ -29,6 +29,7 @@ import co.elastic.clients.elasticsearch.core.search.TotalHits; import co.elastic.clients.json.JsonpMapper; +import java.time.Duration; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -56,6 +57,7 @@ * * @author Peter-Josef Meisch * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.4 */ class SearchDocumentResponseBuilder { @@ -83,8 +85,10 @@ public static SearchDocumentResponse from(ResponseBody response Map>> suggest = responseBody.suggest(); var pointInTimeId = responseBody.pitId(); var shards = responseBody.shards(); + var executionDurationInMillis = responseBody.took(); - return from(hitsMetadata, shards, scrollId, pointInTimeId, aggregations, suggest, entityCreator, jsonpMapper); + return from(hitsMetadata, shards, scrollId, pointInTimeId, executionDurationInMillis, aggregations, suggest, + entityCreator, jsonpMapper); } /** @@ -109,8 +113,10 @@ public static SearchDocumentResponse from(SearchTemplateResponse SearchDocumentResponse from(SearchTemplateResponse SearchDocumentResponse from(HitsMetadata hitsMetadata, @Nullable ShardStatistics shards, - @Nullable String scrollId, @Nullable String pointInTimeId, @Nullable Map aggregations, + @Nullable String scrollId, @Nullable String pointInTimeId, long executionDurationInMillis, @Nullable Map aggregations, Map>> suggestES, SearchDocumentResponse.EntityCreator entityCreator, JsonpMapper jsonpMapper) { @@ -151,6 +157,8 @@ public static SearchDocumentResponse from(HitsMetadata hitsMetadata, @Nul float maxScore = hitsMetadata.maxScore() != null ? hitsMetadata.maxScore().floatValue() : Float.NaN; + Duration executionDuration = Duration.ofMillis(executionDurationInMillis); + List searchDocuments = new ArrayList<>(); for (Hit hit : hitsMetadata.hits()) { searchDocuments.add(DocumentAdapters.from(hit, jsonpMapper)); @@ -163,7 +171,7 @@ public static SearchDocumentResponse from(HitsMetadata hitsMetadata, @Nul SearchShardStatistics shardStatistics = shards != null ? shardsFrom(shards) : null; - return new SearchDocumentResponse(totalHits, totalHitsRelation, maxScore, scrollId, pointInTimeId, searchDocuments, + return new SearchDocumentResponse(totalHits, totalHitsRelation, maxScore, executionDuration, scrollId, pointInTimeId, searchDocuments, aggregationsContainer, suggest, shardStatistics); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java index d382cc0e7..e1b95eb54 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java @@ -17,6 +17,8 @@ import reactor.core.publisher.Flux; +import java.time.Duration; + import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.lang.Nullable; @@ -25,6 +27,7 @@ * * @param the result data class. * @author Peter-Josef Meisch + * @author Mohamed El Harrougui * @since 4.4 */ public interface ReactiveSearchHits { @@ -37,6 +40,11 @@ public interface ReactiveSearchHits { float getMaxScore(); + /** + * @return the execution duration it took to complete the request + */ + Duration getExecutionDuration(); + /** * @return the {@link SearchHit}s from the search result. */ diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java index 84c25d776..7ab10eaf3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java @@ -17,11 +17,14 @@ import reactor.core.publisher.Flux; +import java.time.Duration; + import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch + * @author Mohamed El Harrougui * @since 4.4 */ public class ReactiveSearchHitsImpl implements ReactiveSearchHits { @@ -58,6 +61,11 @@ public float getMaxScore() { return delegate.getMaxScore(); } + @Override + public Duration getExecutionDuration() { + return delegate.getExecutionDuration(); + } + @Override public boolean hasSearchHits() { return delegate.hasSearchHits(); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java index 42fa2da49..8d9689ae3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core; +import java.time.Duration; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.LinkedList; @@ -47,6 +48,7 @@ * @author Sascha Woo * @author Jakob Hoeper * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.0 */ public class SearchHitMapping { @@ -87,6 +89,7 @@ private SearchHitsImpl mapHitsFromResponse(SearchDocumentResponse searchDocum long totalHits = searchDocumentResponse.getTotalHits(); SearchShardStatistics shardStatistics = searchDocumentResponse.getSearchShardStatistics(); float maxScore = searchDocumentResponse.getMaxScore(); + Duration executionDuration = searchDocumentResponse.getExecutionDuration(); String scrollId = searchDocumentResponse.getScrollId(); String pointInTimeId = searchDocumentResponse.getPointInTimeId(); @@ -104,8 +107,8 @@ private SearchHitsImpl mapHitsFromResponse(SearchDocumentResponse searchDocum Suggest suggest = searchDocumentResponse.getSuggest(); mapHitsInCompletionSuggestion(suggest); - return new SearchHitsImpl<>(totalHits, totalHitsRelation, maxScore, scrollId, pointInTimeId, searchHits, - aggregations, suggest, shardStatistics); + return new SearchHitsImpl<>(totalHits, totalHitsRelation, maxScore, executionDuration, scrollId, pointInTimeId, + searchHits, aggregations, suggest, shardStatistics); } @SuppressWarnings("unchecked") @@ -238,6 +241,7 @@ private SearchHits mapInnerDocuments(SearchHits searchHits, C return new SearchHitsImpl<>(searchHits.getTotalHits(), searchHits.getTotalHitsRelation(), searchHits.getMaxScore(), + searchHits.getExecutionDuration(), scrollId, searchHits.getPointInTimeId(), convertedSearchHits, diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java index 023775af8..363369a49 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core; +import java.time.Duration; import java.util.Iterator; import java.util.List; @@ -28,6 +29,7 @@ * @param the result data class. * @author Sascha Woo * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.0 */ public interface SearchHits extends Streamable> { @@ -43,6 +45,11 @@ public interface SearchHits extends Streamable> { */ float getMaxScore(); + /** + * @return the execution duration it took to complete the request + */ + Duration getExecutionDuration(); + /** * @param index position in List. * @return the {@link SearchHit} at position {index} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java index fda8e8a30..f8404b0e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core; +import java.time.Duration; import java.util.Collections; import java.util.List; @@ -30,6 +31,7 @@ * @author Peter-Josef Meisch * @author Sascha Woo * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.0 */ public class SearchHitsImpl implements SearchScrollHits { @@ -37,6 +39,7 @@ public class SearchHitsImpl implements SearchScrollHits { private final long totalHits; private final TotalHitsRelation totalHitsRelation; private final float maxScore; + private final Duration executionDuration; @Nullable private final String scrollId; private final List> searchHits; private final Lazy>> unmodifiableSearchHits; @@ -49,12 +52,13 @@ public class SearchHitsImpl implements SearchScrollHits { * @param totalHits the number of total hits for the search * @param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null} * @param maxScore the maximum score + * @param executionDuration the execution duration it took to complete the request * @param scrollId the scroll id if available * @param searchHits must not be {@literal null} * @param aggregations the aggregations if available */ - public SearchHitsImpl(long totalHits, TotalHitsRelation totalHitsRelation, float maxScore, @Nullable String scrollId, - @Nullable String pointInTimeId, List> searchHits, + public SearchHitsImpl(long totalHits, TotalHitsRelation totalHitsRelation, float maxScore, Duration executionDuration, + @Nullable String scrollId, @Nullable String pointInTimeId, List> searchHits, @Nullable AggregationsContainer aggregations, @Nullable Suggest suggest, @Nullable SearchShardStatistics searchShardStatistics) { @@ -63,6 +67,7 @@ public SearchHitsImpl(long totalHits, TotalHitsRelation totalHitsRelation, float this.totalHits = totalHits; this.totalHitsRelation = totalHitsRelation; this.maxScore = maxScore; + this.executionDuration = executionDuration; this.scrollId = scrollId; this.pointInTimeId = pointInTimeId; this.searchHits = searchHits; @@ -88,6 +93,11 @@ public float getMaxScore() { return maxScore; } + @Override + public Duration getExecutionDuration() { + return executionDuration; + } + @Override @Nullable public String getScrollId() { @@ -133,6 +143,7 @@ public String toString() { "totalHits=" + totalHits + // ", totalHitsRelation=" + totalHitsRelation + // ", maxScore=" + maxScore + // + ", executionDuration=" + executionDuration + // ", scrollId='" + scrollId + '\'' + // ", pointInTimeId='" + pointInTimeId + '\'' + // ", searchHits={" + searchHits.size() + " elements}" + // diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java index 5246903f4..eb9c491b0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java @@ -15,6 +15,8 @@ */ package org.springframework.data.elasticsearch.core; +import java.time.Duration; + import org.springframework.data.util.CloseableIterator; import org.springframework.lang.Nullable; @@ -23,6 +25,7 @@ * {@link java.util.stream.Stream}. * * @author Sascha Woo + * @author Mohamed El Harrougui * @param * @since 4.0 */ @@ -39,6 +42,11 @@ public interface SearchHitsIterator extends CloseableIterator> { */ float getMaxScore(); + /** + * @return the execution duration it took to complete the request + */ + Duration getExecutionDuration(); + /** * @return the number of total hits. */ diff --git a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java index 5c9a04a56..953607c20 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core; +import java.time.Duration; import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; @@ -31,6 +32,7 @@ * * @author Mark Paluch * @author Sascha Woo + * @author Mohamed El Harrougui * @since 3.2 */ abstract class StreamQueries { @@ -56,6 +58,7 @@ static SearchHitsIterator streamResults(int maxCount, SearchScrollHits AggregationsContainer aggregations = searchHits.getAggregations(); float maxScore = searchHits.getMaxScore(); + Duration executionDuration = searchHits.getExecutionDuration(); long totalHits = searchHits.getTotalHits(); TotalHitsRelation totalHitsRelation = searchHits.getTotalHitsRelation(); @@ -86,6 +89,11 @@ public float getMaxScore() { return maxScore; } + @Override + public Duration getExecutionDuration() { + return executionDuration; + } + @Override public long getTotalHits() { return totalHits; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java index 23e0898ac..9009bde01 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core.document; +import java.time.Duration; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.function.Function; @@ -29,6 +30,7 @@ * * @author Peter-Josef Meisch * @author Haibo Liu + * @author Mohamed El Harrougui * @since 4.0 */ public class SearchDocumentResponse { @@ -36,6 +38,7 @@ public class SearchDocumentResponse { private final long totalHits; private final String totalHitsRelation; private final float maxScore; + private final Duration executionDuration; @Nullable private final String scrollId; private final List searchDocuments; @Nullable private final AggregationsContainer aggregations; @@ -44,13 +47,14 @@ public class SearchDocumentResponse { @Nullable String pointInTimeId; @Nullable private final SearchShardStatistics searchShardStatistics; - public SearchDocumentResponse(long totalHits, String totalHitsRelation, float maxScore, @Nullable String scrollId, - @Nullable String pointInTimeId, List searchDocuments, + public SearchDocumentResponse(long totalHits, String totalHitsRelation, float maxScore, Duration executionDuration, + @Nullable String scrollId, @Nullable String pointInTimeId, List searchDocuments, @Nullable AggregationsContainer aggregationsContainer, @Nullable Suggest suggest, @Nullable SearchShardStatistics searchShardStatistics) { this.totalHits = totalHits; this.totalHitsRelation = totalHitsRelation; this.maxScore = maxScore; + this.executionDuration = executionDuration; this.scrollId = scrollId; this.pointInTimeId = pointInTimeId; this.searchDocuments = searchDocuments; @@ -71,6 +75,10 @@ public float getMaxScore() { return maxScore; } + public Duration getExecutionDuration() { + return executionDuration; + } + @Nullable public String getScrollId() { return scrollId; diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java index ee1469178..f5bbb1f7e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java @@ -44,6 +44,7 @@ * * @author Sébastien Comeau * @author Haibo Liu + * @author Mohamed El Harrougui * @since 5.2 */ class SearchDocumentResponseBuilderUnitTests { @@ -54,35 +55,21 @@ class SearchDocumentResponseBuilderUnitTests { void shouldGetPhraseSuggestion() throws JSONException { // arrange final var hitsMetadata = new HitsMetadata.Builder() - .total(total -> total - .value(0) - .relation(TotalHitsRelation.Eq)) - .hits(new ArrayList<>()) - .build(); - - final var suggestionTest = new Suggestion.Builder() - .phrase(phrase -> phrase - .text("National") - .offset(0) - .length(8) - .options(option -> option - .text("nations") - .highlighted("highlighted-nations") - .score(0.11480146) - .collateMatch(false)) - .options(option -> option - .text("national") - .highlighted("highlighted-national") - .score(0.08063514) - .collateMatch(false))) + .total(total -> total.value(0).relation(TotalHitsRelation.Eq)).hits(new ArrayList<>()).build(); + + final var suggestionTest = new Suggestion.Builder().phrase(phrase -> phrase.text("National").offset(0) + .length(8) + .options( + option -> option.text("nations").highlighted("highlighted-nations").score(0.11480146).collateMatch(false)) + .options(option -> option.text("national").highlighted("highlighted-national").score(0.08063514) + .collateMatch(false))) .build(); final var sortProperties = ImmutableMap.>> builder() - .put("suggestionTest", ImmutableList.of(suggestionTest)) - .build(); + .put("suggestionTest", ImmutableList.of(suggestionTest)).build(); // act - final var actual = SearchDocumentResponseBuilder.from(hitsMetadata, null, null, null, null, sortProperties, null, + final var actual = SearchDocumentResponseBuilder.from(hitsMetadata, null, null, null, 0, null, sortProperties, null, jsonpMapper); // assert @@ -122,35 +109,19 @@ void shouldGetPhraseSuggestion() throws JSONException { void shouldGetShardStatisticsInfo() { // arrange HitsMetadata hitsMetadata = new HitsMetadata.Builder() - .total(t -> t - .value(0) - .relation(TotalHitsRelation.Eq)) - .hits(new ArrayList<>()) - .build(); + .total(t -> t.value(0).relation(TotalHitsRelation.Eq)).hits(new ArrayList<>()).build(); - ShardStatistics shards = new ShardStatistics.Builder() - .total(15) - .successful(14) - .skipped(0) - .failed(1) - .failures(List.of( - ShardFailure.of(sfb -> sfb - .index("test-index") - .node("test-node") - .shard(1) - .reason(rb -> rb - .reason("this is a mock failure in shards") - .causedBy(cbb -> cbb.reason("inner reason") - .metadata(Map.of("hello", JsonData.of("world")))) - .type("reason-type") - - ) - .status("fail")))) - .build(); + ShardStatistics shards = new ShardStatistics.Builder().total(15).successful(14).skipped(0).failed(1) + .failures(List.of(ShardFailure.of(sfb -> sfb.index("test-index").node("test-node").shard(1) + .reason(rb -> rb.reason("this is a mock failure in shards") + .causedBy(cbb -> cbb.reason("inner reason").metadata(Map.of("hello", JsonData.of("world")))) + .type("reason-type") + + ).status("fail")))).build(); // act - SearchDocumentResponse response = SearchDocumentResponseBuilder.from(hitsMetadata, shards, null, null, - null, null, null, jsonpMapper); + SearchDocumentResponse response = SearchDocumentResponseBuilder.from(hitsMetadata, shards, null, null, 0, null, + null, null, jsonpMapper); // assert SearchShardStatistics shardStatistics = response.getSearchShardStatistics(); @@ -164,11 +135,9 @@ void shouldGetShardStatisticsInfo() { assertThat(failures.size()).isEqualTo(1); assertThat(failures).extracting(SearchShardStatistics.Failure::getIndex).containsExactly("test-index"); assertThat(failures).extracting(SearchShardStatistics.Failure::getElasticsearchErrorCause) - .extracting(ElasticsearchErrorCause::getReason) - .containsExactly("this is a mock failure in shards"); + .extracting(ElasticsearchErrorCause::getReason).containsExactly("this is a mock failure in shards"); assertThat(failures).extracting(SearchShardStatistics.Failure::getElasticsearchErrorCause) - .extracting(ElasticsearchErrorCause::getCausedBy) - .extracting(ElasticsearchErrorCause::getReason) + .extracting(ElasticsearchErrorCause::getCausedBy).extracting(ElasticsearchErrorCause::getReason) .containsExactly("inner reason"); } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java index 4c5c5a77f..d10b5a91e 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java @@ -24,6 +24,7 @@ import static org.springframework.data.elasticsearch.utils.IdGenerator.*; import static org.springframework.data.elasticsearch.utils.IndexBuilder.*; +import java.time.Duration; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -99,6 +100,7 @@ * @author scoobyzhang * @author Hamid Rahimi * @author Illia Ulianov + * @author Mohamed El Harrougui */ @SpringIntegrationTest public abstract class ElasticsearchIntegrationTests { @@ -1855,7 +1857,7 @@ public void shouldReturnDocumentAboveMinimalScoreGivenQuery() { protected abstract Query getBoolQueryWithWildcardsFirstMustSecondShouldAndMinScore(String firstField, String firstValue, String secondField, String secondValue, float minScore); - @Test // DATAES-462 + @Test // DATAES-462, #2986 public void shouldReturnScores() { List indexQueries = new ArrayList<>(); @@ -1872,6 +1874,7 @@ public void shouldReturnScores() { IndexCoordinates.of(indexNameProvider.indexName())); assertThat(searchHits.getMaxScore()).isGreaterThan(0f); + assertThat(searchHits.getExecutionDuration().toMillis()).isGreaterThan(0); assertThat(searchHits.getSearchHit(0).getScore()).isGreaterThan(0f); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java index bedc20c8b..3dd7a35cc 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java @@ -19,6 +19,7 @@ import static org.assertj.core.api.Assertions.*; import static org.mockito.Mockito.*; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -33,6 +34,7 @@ * @author Roman Puchkovskiy * @author Peter-Josef Meisch * @author Haibo Liu + * @author Mohamed El Harrougui */ class SearchHitSupportTest { @@ -65,8 +67,8 @@ void shouldReturnTheSameListInstanceInSearchHitsAndGetContent() { hits.add(new SearchHit<>(null, null, null, 0, null, null, null, null, null, null, "four")); hits.add(new SearchHit<>(null, null, null, 0, null, null, null, null, null, null, "five")); - SearchHits originalSearchHits = new SearchHitsImpl<>(hits.size(), TotalHitsRelation.EQUAL_TO, 0, "scroll", - null, hits, null, null, null); + SearchHits originalSearchHits = new SearchHitsImpl<>(hits.size(), TotalHitsRelation.EQUAL_TO, 0, + Duration.ofMillis(1), "scroll", null, hits, null, null, null); SearchPage searchPage = SearchHitSupport.searchPageFor(originalSearchHits, PageRequest.of(0, 3)); SearchHits searchHits = searchPage.getSearchHits(); @@ -89,6 +91,11 @@ public float getMaxScore() { return 0; } + @Override + public Duration getExecutionDuration() { + return Duration.ofMillis(1); + } + @Override public long getTotalHits() { return 2; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java b/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java index 5b14e8c76..b9e6abfc8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -32,6 +33,7 @@ * @author Sascha Woo * @author Peter-Josef Meisch * @author Haibo Liu + * @author Mohamed El Harrougui */ public class StreamQueriesTest { @@ -181,6 +183,7 @@ void shouldOnlyReturnRequestedCount() { } private SearchScrollHits newSearchScrollHits(List> hits, String scrollId) { - return new SearchHitsImpl<>(hits.size(), TotalHitsRelation.EQUAL_TO, 0, scrollId, null, hits, null, null, null); + return new SearchHitsImpl<>(hits.size(), TotalHitsRelation.EQUAL_TO, 0, Duration.ofMillis(1), scrollId, null, hits, + null, null, null); } } From 3e2c67a39fcbbe89cdcc29030d3a55746f9d5b01 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 22 Oct 2024 06:13:44 +0200 Subject: [PATCH 051/131] Update elasticsearch-new.adoc --- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 1 + 1 file changed, 1 insertion(+) 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 b7bca8abd..9f9df308a 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -7,6 +7,7 @@ * Upgrade to Elasticsearch 8.15.0. * Allow to customize the mapped type name for `@InnerField` and `@Field` annotations. * Support for Elasticsearch SQL. +* Add support for retrieving request executionDuration. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 From 24618ecfbe774f7a75b0703e97066c60951408fe Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 29 Oct 2024 11:37:38 +0100 Subject: [PATCH 052/131] Upgrade dependency to elasticsearch 8.15.3. Original Pull Request #2994 Closes #2993 --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 210333c13..bee20b1be 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.4.0-SNAPSHOT - 8.15.0 + 8.15.3 0.19.0 2.23.1 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 9f9df308a..5eb6ae594 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-4-0]] == New in Spring Data Elasticsearch 5.4 -* Upgrade to Elasticsearch 8.15.0. +* Upgrade to Elasticsearch 8.15.3. * Allow to customize the mapped type name for `@InnerField` and `@Field` annotations. * Support for Elasticsearch SQL. * Add support for retrieving request executionDuration. diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 7deac45f9..50f11a802 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 -| 2024.1 (in development) | 5.3.x | 8.15.0 | 6.1.x +| 2024.1 (in development) | 5.3.x | 8.15.3 | 6.1.x | 2024.0 | 5.3.1 | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index d03727107..9d1fb89d5 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.15.0 +sde.testcontainers.image-version=8.15.3 # # # 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 From 61176940cbb3c4bdbaa8ee4d932c9b55e48f8c85 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 7 Nov 2024 09:47:28 +0100 Subject: [PATCH 053/131] Upgrade to Maven Wrapper 3.9.9. See #2998 --- .mvn/wrapper/maven-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 8f451732e..e075a74d8 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,3 +1,3 @@ -#Thu Aug 08 10:22:09 CEST 2024 +#Thu Nov 07 09:47:28 CET 2024 wrapperUrl=https\://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar -distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip +distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip From 7f5bfffc348786a80444e9e16247a9dc657693f0 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 8 Nov 2024 18:55:15 +0100 Subject: [PATCH 054/131] fix geohash conversion Original Pull Request #3002 Closes #3001 --- .../data/elasticsearch/utils/geohash/Geohash.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java index 410f06778..cc1f74e10 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.Collection; +import java.util.Locale; import org.springframework.util.Assert; @@ -84,7 +85,7 @@ public static String toLatLon(final String geohash) { Assert.notNull(geohash, "geohash must not be null"); var point = Geohash.toPoint(geohash); - return String.format("%f,%f", point.getLat(), point.getLon()); + return String.format(Locale.ROOT, "%f,%f", point.getLat(), point.getLon()); } /** From f5b29cb524436bc1641cdf787582b96411cf9da0 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 15 Nov 2024 10:39:50 +0100 Subject: [PATCH 055/131] Update CI Properties. See #2990 --- ci/pipeline.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 40bb34919..cd2fcf7fb 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -1,6 +1,6 @@ # Java versions -java.main.tag=17.0.12_7-jdk-focal -java.next.tag=22.0.2_9-jdk-jammy +java.main.tag=17.0.13_11-jdk-focal +java.next.tag=23.0.1_11-jdk-noble # Docker container images - standard docker.java.main.image=library/eclipse-temurin:${java.main.tag} @@ -11,6 +11,7 @@ docker.mongodb.4.4.version=4.4.25 docker.mongodb.5.0.version=5.0.21 docker.mongodb.6.0.version=6.0.10 docker.mongodb.7.0.version=7.0.2 +docker.mongodb.8.0.version=8.0.0 # Supported versions of Redis docker.redis.6.version=6.2.13 From bfd3c35d935e1ad6aeeb07be98fa170206522124 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 15 Nov 2024 14:10:37 +0100 Subject: [PATCH 056/131] Prepare 5.4 GA (2024.1.0). See #2990 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index bee20b1be..6b70b219f 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0-SNAPSHOT + 3.4.0 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0-SNAPSHOT + 3.4.0 8.15.3 @@ -450,20 +450,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 1b8a6296b..2e344df6d 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.4 RC1 (2024.1.0) +Spring Data Elasticsearch 5.4 GA (2024.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -24,3 +24,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 6f3941b43bcb5313ddcc5c11df90f776fe750bb4 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 15 Nov 2024 14:10:52 +0100 Subject: [PATCH 057/131] Release version 5.4 GA (2024.1.0). See #2990 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6b70b219f..5c03fa466 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0-SNAPSHOT + 5.4.0 org.springframework.data.build From 00f13ac3e90a287e2271562a5208b21aa9a47ba8 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 15 Nov 2024 14:13:08 +0100 Subject: [PATCH 058/131] Prepare next development iteration. See #2990 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c03fa466..b59b4688f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.4.0 + 5.5.0-SNAPSHOT org.springframework.data.build From 4f159d5de506962739fbc82705e4e684a56fc9b7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 15 Nov 2024 14:13:09 +0100 Subject: [PATCH 059/131] After release cleanups. See #2990 --- pom.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index b59b4688f..498aa9bdd 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.4.0 + 3.5.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.4.0 + 3.5.0-SNAPSHOT 8.15.3 @@ -450,8 +450,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From 01d2d2491682fba1d7426f960e1f143825d6a8ea Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 24 Nov 2024 10:43:11 +0100 Subject: [PATCH 060/131] Update versions documentation. Original Pull Request #3013 Closes #3012 --- README.adoc | 2 +- src/main/antora/antora-playbook.yml | 2 +- src/main/antora/modules/ROOT/nav.adoc | 1 + .../modules/ROOT/pages/elasticsearch/versions.adoc | 11 ++++++----- .../migration-guides/migration-guide-5.4-5.5.adoc | 12 ++++++++++++ 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc diff --git a/README.adoc b/README.adoc index 5864ee067..2eaf7aeaa 100644 --- a/README.adoc +++ b/README.adoc @@ -168,7 +168,7 @@ Building the documentation builds also the project without running tests. $ ./mvnw clean install -Pantora ---- -The generated documentation is available from `target/antora/site/index.html`. +The generated documentation is available from `target/site/index.html`. == Examples diff --git a/src/main/antora/antora-playbook.yml b/src/main/antora/antora-playbook.yml index 5f4f76e06..1a4f73c1e 100644 --- a/src/main/antora/antora-playbook.yml +++ b/src/main/antora/antora-playbook.yml @@ -17,7 +17,7 @@ content: - url: https://github.com/spring-projects/spring-data-commons # Refname matching: # https://docs.antora.org/antora/latest/playbook/content-refname-matching/ - branches: [ main, 3.2.x ] + branches: [ main, 3.4.x, 3.3.x ] start_path: src/main/antora asciidoc: attributes: diff --git a/src/main/antora/modules/ROOT/nav.adoc b/src/main/antora/modules/ROOT/nav.adoc index 9bd1c8411..53580343a 100644 --- a/src/main/antora/modules/ROOT/nav.adoc +++ b/src/main/antora/modules/ROOT/nav.adoc @@ -11,6 +11,7 @@ *** xref:migration-guides/migration-guide-5.1-5.2.adoc[] *** xref:migration-guides/migration-guide-5.2-5.3.adoc[] *** xref:migration-guides/migration-guide-5.3-5.4.adoc[] +*** xref:migration-guides/migration-guide-5.4-5.5.adoc[] * xref:elasticsearch.adoc[] diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 50f11a802..1b6d630c4 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,11 +6,12 @@ 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 -| 2024.1 (in development) | 5.3.x | 8.15.3 | 6.1.x -| 2024.0 | 5.3.1 | 8.13.4 | 6.1.x -| 2023.1 (Vaughan) | 5.2.x | 8.11.1 | 6.1.x -| 2023.0 (Ullmann) | 5.1.x | 8.7.1 | 6.0.x -| 2022.0 (Turing) | 5.0.xfootnote:oom[Out of maintenance] | 8.5.3 | 6.0.x +| 2025.0 (in development) | 5.5.x | 8.15.3 | 6.2.x +| 2024.1 | 5.4.x | 8.15.3 | 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 +| 2023.0 (Ullmann) | 5.1.xfootnote:oom[] | 8.7.1 | 6.0.x +| 2022.0 (Turing) | 5.0.xfootnote:oom[] | 8.5.3 | 6.0.x | 2021.2 (Raj) | 4.4.xfootnote:oom[] | 7.17.3 | 5.3.x | 2021.1 (Q) | 4.3.xfootnote:oom[] | 7.15.2 | 5.3.x | 2021.0 (Pascal) | 4.2.xfootnote:oom[] | 7.12.0 | 5.3.x diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc new file mode 100644 index 000000000..6fe54134d --- /dev/null +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc @@ -0,0 +1,12 @@ +[[elasticsearch-migration-guide-5.4-5.5]] += Upgrading from 5.4.x to 5.5.x + +This section describes breaking changes from version 5.4.x to 5.5.x and how removed features can be replaced by new introduced features. + +[[elasticsearch-migration-guide-5.4-5.5.breaking-changes]] +== Breaking Changes + +[[elasticsearch-migration-guide-5.4-5.5.deprecations]] +== Deprecations + +=== Removals From 028239fbdbc469a1c79006e60a4d30036bc620cf Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 28 Nov 2024 15:37:19 +0100 Subject: [PATCH 061/131] Add optional fetchSource flag to the SourceFilter. Original Pull Request #3014 Closes #3009 --- .../client/elc/RequestConverter.java | 14 +++++--- .../MappingElasticsearchConverter.java | 2 +- .../core/query/FetchSourceFilter.java | 15 +++++++-- .../core/query/FetchSourceFilterBuilder.java | 8 ++++- .../core/query/SourceFilter.java | 11 +++++++ .../core/SourceFilterIntegrationTests.java | 33 +++++++++++++++++++ 6 files changed, 74 insertions(+), 9 deletions(-) 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 ea42903a5..ec934452e 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 @@ -2014,9 +2014,12 @@ private VersionType retrieveVersionTypeFromPersistentEntity(@Nullable Class c private SourceConfig getSourceConfig(Query query) { if (query.getSourceFilter() != null) { - return SourceConfig.of(s -> s // - .filter(sfb -> { - SourceFilter sourceFilter = query.getSourceFilter(); + return SourceConfig.of(s -> { + SourceFilter sourceFilter = query.getSourceFilter(); + if (sourceFilter.fetchSource() != null) { + s.fetch(sourceFilter.fetchSource()); + } else { + s.filter(sfb -> { String[] includes = sourceFilter.getIncludes(); String[] excludes = sourceFilter.getExcludes(); @@ -2029,7 +2032,10 @@ private SourceConfig getSourceConfig(Query query) { } return sfb; - })); + }); + } + return s; + }); } else { return null; } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index ccac971fd..0ae0e8928 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -1273,7 +1273,7 @@ private void updatePropertiesInFieldsAndSourceFilter(Query query, Class domai .toArray(new String[] {}); } - query.addSourceFilter(new FetchSourceFilter(includes, excludes)); + query.addSourceFilter(new FetchSourceFilter(sourceFilter.fetchSource(), includes, excludes)); } } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java index caca169c6..ced12f407 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java @@ -28,14 +28,16 @@ */ public class FetchSourceFilter implements SourceFilter { + @Nullable private final Boolean fetchSource; @Nullable private final String[] includes; @Nullable private final String[] excludes; /** * @since 5.2 */ - public static SourceFilter of(@Nullable final String[] includes, @Nullable final String[] excludes) { - return new FetchSourceFilter(includes, excludes); + public static SourceFilter of(@Nullable Boolean fetchSource, @Nullable final String[] includes, + @Nullable final String[] excludes) { + return new FetchSourceFilter(fetchSource, includes, excludes); } /** @@ -48,11 +50,18 @@ public static SourceFilter of(Function b.withFetchSource(false))); + + SearchHits entities = operations.search(query, Entity.class); + + assertThat(entities).hasSize(1); + Entity entity = entities.getSearchHit(0).getContent(); + assertThat(entity.getField1()).isNull(); + assertThat(entity.getField2()).isNull(); + assertThat(entity.getField3()).isNull(); + } + + @Test // #3009 + @DisplayName("should return all fields when source is set to true") + void shouldReturnAllFieldsWhenSourceIsSetToTrue() { + + Query query = Query.findAll(); + query.addSourceFilter(FetchSourceFilter.of(b -> b.withFetchSource(true))); + + SearchHits entities = operations.search(query, Entity.class); + + assertThat(entities).hasSize(1); + Entity entity = entities.getSearchHit(0).getContent(); + assertThat(entity.getField1()).isNotNull(); + assertThat(entity.getField2()).isNotNull(); + assertThat(entity.getField3()).isNotNull(); + } + @Document(indexName = "#{@indexNameProvider.indexName()}") public static class Entity { @Nullable From 5f297f1dc3da9102e6d0a58b8e1a1f4c73c3d4b5 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 1 Dec 2024 13:49:43 +0100 Subject: [PATCH 062/131] Upgrade to Elasticsearch 8.16.1. Original Pull Request #3019 Closes #3017 --- pom.xml | 2 +- .../elasticsearch/elasticsearch-new.adoc | 6 +++- .../ROOT/pages/elasticsearch/versions.adoc | 4 +-- .../elc/AutoCloseableElasticsearchClient.java | 9 ++++-- .../client/elc/ElasticsearchClients.java | 2 +- .../elc/ElasticsearchConfiguration.java | 2 +- .../elc/ReactiveElasticsearchClient.java | 14 +++++++--- .../ReactiveElasticsearchConfiguration.java | 2 +- .../client/elc/RequestConverter.java | 28 +++++++++++-------- .../highlight/HighlightCommonParameters.java | 8 ++++++ .../core/SearchOperationsExtensions.kt | 4 +-- .../elasticsearch/client/elc/DevTests.java | 2 +- .../testcontainers-elasticsearch.properties | 2 +- 13 files changed, 57 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 498aa9bdd..8d4a07dae 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.15.3 + 8.16.1 0.19.0 2.23.1 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 5eb6ae594..53990f678 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -1,13 +1,17 @@ [[new-features]] = What's new +[[new-features.5-5-0]] +== New in Spring Data Elasticsearch 5.5 +* Upgrade to Elasticsearch 8.16.1. + [[new-features.5-4-0]] == New in Spring Data Elasticsearch 5.4 * Upgrade to Elasticsearch 8.15.3. * Allow to customize the mapped type name for `@InnerField` and `@Field` annotations. * Support for Elasticsearch SQL. -* Add support for retrieving request executionDuration. +* Add support for retrieving request executionDuration. [[new-features.5-3-0]] == New in Spring Data Elasticsearch 5.3 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 1b6d630c4..962dd82aa 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,8 +6,8 @@ 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.15.3 | 6.2.x -| 2024.1 | 5.4.x | 8.15.3 | 6.1.x +| 2025.0 (in development) | 5.5.x | 8.16.1 | 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 | 2023.0 (Ullmann) | 5.1.xfootnote:oom[] | 8.7.1 | 6.0.x diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java index fe6afc148..9a074b4a2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java @@ -18,6 +18,8 @@ import co.elastic.clients.elasticsearch.ElasticsearchClient; import co.elastic.clients.transport.ElasticsearchTransport; +import java.io.IOException; + import org.elasticsearch.client.RestClient; import org.springframework.util.Assert; @@ -36,7 +38,10 @@ public AutoCloseableElasticsearchClient(ElasticsearchTransport transport) { } @Override - public void close() throws Exception { - transport.close(); + public void close() throws IOException { + // since Elasticsearch 8.16 the ElasticsearchClient implements (through ApiClient) the Closeable interface and + // handles closing of the underlying transport. We now just call the base class, but keep this as we + // have been implementing AutoCloseable since 4.4 and won't change that to a mere Closeable + super.close(); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java index 85620fe20..d331f36c1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java @@ -329,7 +329,7 @@ public static ElasticsearchTransport getElasticsearchTransport(RestClient restCl Assert.notNull(jsonpMapper, "jsonpMapper must not be null"); TransportOptions.Builder transportOptionsBuilder = transportOptions != null ? transportOptions.toBuilder() - : new RestClientOptions(RequestOptions.DEFAULT).toBuilder(); + : new RestClientOptions(RequestOptions.DEFAULT, false).toBuilder(); RestClientOptions.Builder restClientOptionsBuilder = getRestClientOptionsBuilder(transportOptions); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java index a0632d557..28bcbeca7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java @@ -135,6 +135,6 @@ public JsonpMapper jsonpMapper() { * @return the options that should be added to every request. Must not be {@literal null} */ public TransportOptions transportOptions() { - return new RestClientOptions(RequestOptions.DEFAULT); + return new RestClientOptions(RequestOptions.DEFAULT, false); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index 958b1f59f..c77159f38 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -27,6 +27,7 @@ import co.elastic.clients.util.ObjectBuilder; import reactor.core.publisher.Mono; +import java.io.IOException; import java.util.function.Function; import org.springframework.lang.Nullable; @@ -56,8 +57,11 @@ public ReactiveElasticsearchClient withTransportOptions(@Nullable TransportOptio } @Override - public void close() throws Exception { - transport.close(); + public void close() throws IOException { + // since Elasticsearch 8.16 the ElasticsearchClient implements (through ApiClient) the Closeable interface and + // handles closing of the underlying transport. We now just call the base class, but keep this as we + // have been implementing AutoCloseable since 4.4 and won't change that to a mere Closeable + super.close(); } // region child clients @@ -127,7 +131,8 @@ public Mono> get(GetRequest request, Class tClass) { // java.lang.Class) // noinspection unchecked JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.get.Response.TDocument", + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tClass)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, transportOptions)); @@ -172,7 +177,8 @@ public Mono> mget(MgetRequest request, Class clazz) { // noinspection unchecked JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", this.getDeserializer(clazz)); return Mono.fromFuture(transport.performRequestAsync(request, endpoint, transportOptions)); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java index 6117f2830..6414fcb80 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java @@ -125,6 +125,6 @@ public JsonpMapper jsonpMapper() { * @return the options that should be added to every request. Must not be {@literal null} */ public TransportOptions transportOptions() { - return new RestClientOptions(RequestOptions.DEFAULT).toBuilder().build(); + return new RestClientOptions(RequestOptions.DEFAULT, false).toBuilder().build(); } } 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 ec934452e..20670bff3 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 @@ -51,6 +51,7 @@ 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; import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -533,17 +534,22 @@ public co.elastic.clients.elasticsearch.indices.GetTemplateRequest indicesGetTem public co.elastic.clients.elasticsearch.sql.QueryRequest sqlQueryRequest(SqlQuery query) { Assert.notNull(query, "Query must not be null."); - return co.elastic.clients.elasticsearch.sql.QueryRequest.of(sqb -> { - sqb.query(query.getQuery()).catalog(query.getCatalog()).columnar(query.getColumnar()).cursor(query.getCursor()) - .fetchSize(query.getFetchSize()).fieldMultiValueLeniency(query.getFieldMultiValueLeniency()) - .indexUsingFrozen(query.getIndexIncludeFrozen()).keepAlive(time(query.getKeepAlive())) - .keepOnCompletion(query.getKeepOnCompletion()).pageTimeout(time(query.getPageTimeout())) - .requestTimeout(time(query.getRequestTimeout())) - .waitForCompletionTimeout(time(query.getWaitForCompletionTimeout())).filter(getQuery(query.getFilter(), null)) - .timeZone(Objects.toString(query.getTimeZone(), null)).format("json"); - - return sqb; - }); + return co.elastic.clients.elasticsearch.sql.QueryRequest.of(sqb -> sqb + .query(query.getQuery()) + .catalog(query.getCatalog()) + .columnar(query.getColumnar()) + .cursor(query.getCursor()) + .fetchSize(query.getFetchSize()) + .fieldMultiValueLeniency(query.getFieldMultiValueLeniency()) + .indexUsingFrozen(query.getIndexIncludeFrozen()) + .keepAlive(time(query.getKeepAlive())) + .keepOnCompletion(query.getKeepOnCompletion()) + .pageTimeout(time(query.getPageTimeout())) + .requestTimeout(time(query.getRequestTimeout())) + .waitForCompletionTimeout(time(query.getWaitForCompletionTimeout())) + .filter(getQuery(query.getFilter(), null)) + .timeZone(Objects.toString(query.getTimeZone(), null)) + .format(SqlFormat.Json)); } // endregion diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java index a63185bbc..1541d9f95 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java @@ -80,6 +80,10 @@ public String getBoundaryScannerLocale() { return boundaryScannerLocale; } + /** + * @deprecated the underlying functionality is deprecated since Elasticsearch 8.8. + */ + @Deprecated(since = "5.5") public boolean getForceSource() { return forceSource; } @@ -173,6 +177,10 @@ public SELF withBoundaryScannerLocale(String boundaryScannerLocale) { return (SELF) this; } + /** + * @deprecated the underlying functionality is deprecated since Elasticsearch 8.8. + */ + @Deprecated(since = "5.5") public SELF withForceSource(boolean forceSource) { this.forceSource = forceSource; return (SELF) this; diff --git a/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt b/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt index c8b67855c..4e3839d95 100644 --- a/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt +++ b/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt @@ -33,11 +33,11 @@ inline fun SearchOperations.searchOne(query: Query): SearchHit inline fun SearchOperations.searchOne(query: Query, index: IndexCoordinates): SearchHit? = searchOne(query, T::class.java, index) -inline fun SearchOperations.multiSearch(queries: List): List> = +inline fun SearchOperations.multiSearch(queries: List): List> = multiSearch(queries, T::class.java) inline fun SearchOperations.multiSearch( - queries: List, + queries: List, index: IndexCoordinates ): List> = multiSearch(queries, T::class.java, index) diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java index 81aabf402..9d5a1f837 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java @@ -77,7 +77,7 @@ public class DevTests { private static final SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext(); private static final MappingElasticsearchConverter converter = new MappingElasticsearchConverter(mappingContext); - private final TransportOptions transportOptions = new RestClientOptions(RequestOptions.DEFAULT).toBuilder() + private final TransportOptions transportOptions = new RestClientOptions(RequestOptions.DEFAULT, false).toBuilder() .addHeader("X-SpringDataElasticsearch-AlwaysThere", "true").setParameter("pretty", "true").build(); private final JsonpMapper jsonpMapper = new JacksonJsonpMapper(); diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 9d1fb89d5..3f55e3381 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.15.3 +sde.testcontainers.image-version=8.16.1 # # # 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 From 944e7e81ddf0482ea996be32253c9cbfd65d1e4f Mon Sep 17 00:00:00 2001 From: Alfonso Date: Sat, 14 Dec 2024 09:04:06 -0800 Subject: [PATCH 063/131] fix: use scripted field name to populate entity. Original Pull Request: #3023 Closes: #3022 --- .../MappingElasticsearchConverter.java | 10 +-- ...appingElasticsearchConverterUnitTests.java | 65 +++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index 0ae0e8928..606c5b945 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -85,6 +85,7 @@ * @author Anton Naydenov * @author vdisk * @author Junghoon Ban + * @author llosimura * @since 3.2 */ public class MappingElasticsearchConverter @@ -653,13 +654,14 @@ private void populateScriptFields(ElasticsearchPersistentEntity entity, T SearchDocument searchDocument) { Map> fields = searchDocument.getFields(); entity.doWithProperties((SimplePropertyHandler) property -> { - if (property.isAnnotationPresent(ScriptedField.class) && fields.containsKey(property.getName())) { + if (property.isAnnotationPresent(ScriptedField.class)) { ScriptedField scriptedField = property.findAnnotation(ScriptedField.class); // noinspection ConstantConditions String name = scriptedField.name().isEmpty() ? property.getName() : scriptedField.name(); - Object value = searchDocument.getFieldValue(name); - - entity.getPropertyAccessor(result).setProperty(property, value); + if (fields.containsKey(name)) { + Object value = searchDocument.getFieldValue(name); + entity.getPropertyAccessor(result).setProperty(property, value); + } } }); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java index be1ba7b0c..b2575f6ad 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java @@ -49,8 +49,10 @@ import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.GeoPointField; +import org.springframework.data.elasticsearch.annotations.ScriptedField; import org.springframework.data.elasticsearch.annotations.ValueConverter; import org.springframework.data.elasticsearch.core.document.Document; +import org.springframework.data.elasticsearch.core.document.SearchDocumentAdapter; import org.springframework.data.elasticsearch.core.geo.GeoJsonEntity; import org.springframework.data.elasticsearch.core.geo.GeoJsonGeometryCollection; import org.springframework.data.elasticsearch.core.geo.GeoJsonLineString; @@ -83,6 +85,7 @@ * @author Konrad Kurdej * @author Roman Puchkovskiy * @author Sascha Woo + * @author llosimura */ public class MappingElasticsearchConverterUnitTests { @@ -1800,6 +1803,68 @@ void shouldReadASingleStringIntoAListPropertyImmutable() { assertThat(entity.getStringList()).containsExactly("foo"); } + @Test + void shouldPopulateScriptedFields() { + SearchDocumentAdapter document = new SearchDocumentAdapter(Document.create(), + 0.0f, + new Object[]{}, + Map.of( + "scriptedField" , List.of("scriptedField"), + "custom-name-scripted-field" , List.of("custom-name-scripted-field") + ), + emptyMap(), + emptyMap(), + null, + null, + null, + null + ); + // Create a SearchDocument instance + var entity = mappingElasticsearchConverter.read(ScriptedEntity.class, document); + assertThat(entity.customScriptedField).isEqualTo("custom-name-scripted-field"); + assertThat(entity.scriptedField).isEqualTo("scriptedField"); + } + + static class ScriptedEntity { + @ScriptedField + private String scriptedField; + @ScriptedField(name = "custom-name-scripted-field") String customScriptedField; + + ScriptedEntity() { + customScriptedField = ""; + scriptedField = ""; + } + + public String getScriptedField() { + return scriptedField; + } + + public void setScriptedField(String scriptedField) { + this.scriptedField = scriptedField; + } + + public String getCustomScriptedField() { + return customScriptedField; + } + + public void setCustomScriptedField(String customScriptedField) { + this.customScriptedField = customScriptedField; + } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + ScriptedEntity that = (ScriptedEntity) o; + return Objects.equals(scriptedField, that.scriptedField) && Objects.equals(customScriptedField, that.customScriptedField); + } + + @Override + public int hashCode() { + return Objects.hash(scriptedField, customScriptedField); + } + } + + @Test // #2280 @DisplayName("should read a String array into a List property immutable") void shouldReadAStringArrayIntoAListPropertyImmutable() { From a94b74c877e414fc0fc44c6a583319a77b0f6dbf Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 15 Dec 2024 19:16:38 +0100 Subject: [PATCH 064/131] Upgrade to Elasticsearch 8.17.0. (#3027) Closes #3026 --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8d4a07dae..747edaccb 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.16.1 + 8.17.0 0.19.0 2.23.1 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 53990f678..4f481f347 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -3,7 +3,7 @@ [[new-features.5-5-0]] == New in Spring Data Elasticsearch 5.5 -* Upgrade to Elasticsearch 8.16.1. +* Upgrade to Elasticsearch 8.17.0. [[new-features.5-4-0]] == New in Spring Data Elasticsearch 5.4 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 962dd82aa..05533ddb6 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.16.1 | 6.2.x +| 2025.0 (in development) | 5.5.x | 8.17.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/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 3f55e3381..073308e0c 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.16.1 +sde.testcontainers.image-version=8.17.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 From 03591326d77f610fdc0be430af683dc8b4233d32 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 2 Jan 2025 19:12:45 +0100 Subject: [PATCH 065/131] Update copyright comment to 2025. Original Pull Request #3031 Closes #3030 --- .../data/elasticsearch/BulkFailureException.java | 2 +- .../data/elasticsearch/ElasticsearchErrorCause.java | 2 +- .../data/elasticsearch/NoSuchIndexException.java | 2 +- .../data/elasticsearch/ResourceFailureException.java | 2 +- .../data/elasticsearch/ResourceNotFoundException.java | 2 +- .../data/elasticsearch/RestStatusException.java | 2 +- .../UncategorizedElasticsearchException.java | 2 +- .../data/elasticsearch/VersionConflictException.java | 2 +- .../data/elasticsearch/annotations/Alias.java | 2 +- .../data/elasticsearch/annotations/Aliases.java | 2 +- .../data/elasticsearch/annotations/CompletionContext.java | 2 +- .../data/elasticsearch/annotations/CompletionField.java | 2 +- .../data/elasticsearch/annotations/CountQuery.java | 2 +- .../data/elasticsearch/annotations/DateFormat.java | 2 +- .../data/elasticsearch/annotations/Document.java | 2 +- .../data/elasticsearch/annotations/Dynamic.java | 2 +- .../data/elasticsearch/annotations/Field.java | 2 +- .../data/elasticsearch/annotations/FieldElementType.java | 2 +- .../data/elasticsearch/annotations/FieldType.java | 2 +- .../data/elasticsearch/annotations/Filter.java | 2 +- .../data/elasticsearch/annotations/GeoPointField.java | 2 +- .../data/elasticsearch/annotations/GeoShapeField.java | 2 +- .../data/elasticsearch/annotations/Highlight.java | 2 +- .../data/elasticsearch/annotations/HighlightField.java | 2 +- .../elasticsearch/annotations/HighlightParameters.java | 2 +- .../data/elasticsearch/annotations/IndexOptions.java | 2 +- .../data/elasticsearch/annotations/IndexPrefixes.java | 2 +- .../data/elasticsearch/annotations/IndexedIndexName.java | 2 +- .../data/elasticsearch/annotations/InnerField.java | 2 +- .../data/elasticsearch/annotations/JoinTypeRelation.java | 2 +- .../data/elasticsearch/annotations/JoinTypeRelations.java | 2 +- .../data/elasticsearch/annotations/KnnAlgorithmType.java | 2 +- .../data/elasticsearch/annotations/KnnIndexOptions.java | 2 +- .../data/elasticsearch/annotations/KnnSimilarity.java | 2 +- .../data/elasticsearch/annotations/Mapping.java | 2 +- .../data/elasticsearch/annotations/MappingAlias.java | 2 +- .../data/elasticsearch/annotations/MultiField.java | 2 +- .../data/elasticsearch/annotations/NullValueType.java | 2 +- .../data/elasticsearch/annotations/Query.java | 2 +- .../data/elasticsearch/annotations/Setting.java | 2 +- .../data/elasticsearch/annotations/Similarity.java | 2 +- .../data/elasticsearch/annotations/SourceFilters.java | 2 +- .../data/elasticsearch/annotations/TermVector.java | 2 +- .../data/elasticsearch/annotations/ValueConverter.java | 4 ++-- .../data/elasticsearch/annotations/WriteOnlyProperty.java | 2 +- .../data/elasticsearch/annotations/WriteTypeHint.java | 2 +- .../elasticsearch/aot/ElasticsearchAotPredicates.java | 2 +- .../aot/SpringDataElasticsearchRuntimeHints.java | 2 +- .../data/elasticsearch/client/ClientConfiguration.java | 2 +- .../elasticsearch/client/ClientConfigurationBuilder.java | 2 +- .../elasticsearch/client/DefaultClientConfiguration.java | 2 +- .../data/elasticsearch/client/ElasticsearchHost.java | 2 +- .../elasticsearch/client/InetSocketAddressParser.java | 2 +- .../elasticsearch/client/NoReachableHostException.java | 2 +- .../elasticsearch/client/UnsupportedBackendOperation.java | 2 +- .../client/UnsupportedClientOperationException.java | 2 +- .../elasticsearch/client/elc/AbstractQueryProcessor.java | 2 +- .../data/elasticsearch/client/elc/Aggregation.java | 2 +- .../client/elc/AutoCloseableElasticsearchClient.java | 2 +- .../data/elasticsearch/client/elc/ChildTemplate.java | 2 +- .../data/elasticsearch/client/elc/ClusterTemplate.java | 2 +- .../elasticsearch/client/elc/CriteriaFilterProcessor.java | 2 +- .../elasticsearch/client/elc/CriteriaQueryException.java | 2 +- .../elasticsearch/client/elc/CriteriaQueryProcessor.java | 2 +- .../data/elasticsearch/client/elc/DocumentAdapters.java | 2 +- .../client/elc/ElasticsearchAggregation.java | 2 +- .../client/elc/ElasticsearchAggregations.java | 2 +- .../elc/ElasticsearchClientBeanDefinitionParser.java | 2 +- .../client/elc/ElasticsearchClientFactoryBean.java | 2 +- .../elasticsearch/client/elc/ElasticsearchClients.java | 2 +- .../client/elc/ElasticsearchConfiguration.java | 2 +- .../client/elc/ElasticsearchExceptionTranslator.java | 2 +- .../elasticsearch/client/elc/ElasticsearchTemplate.java | 2 +- .../data/elasticsearch/client/elc/EntityAsMap.java | 2 +- .../elasticsearch/client/elc/HighlightQueryBuilder.java | 2 +- .../data/elasticsearch/client/elc/IndicesTemplate.java | 2 +- .../data/elasticsearch/client/elc/JsonUtils.java | 2 +- .../data/elasticsearch/client/elc/NativeQuery.java | 2 +- .../data/elasticsearch/client/elc/NativeQueryBuilder.java | 2 +- .../data/elasticsearch/client/elc/Queries.java | 2 +- .../elasticsearch/client/elc/ReactiveChildTemplate.java | 2 +- .../elasticsearch/client/elc/ReactiveClusterTemplate.java | 2 +- .../client/elc/ReactiveElasticsearchClient.java | 2 +- .../client/elc/ReactiveElasticsearchClusterClient.java | 2 +- .../client/elc/ReactiveElasticsearchConfiguration.java | 2 +- .../client/elc/ReactiveElasticsearchIndicesClient.java | 2 +- .../client/elc/ReactiveElasticsearchSqlClient.java | 2 +- .../client/elc/ReactiveElasticsearchTemplate.java | 2 +- .../elasticsearch/client/elc/ReactiveIndicesTemplate.java | 2 +- .../data/elasticsearch/client/elc/RequestConverter.java | 2 +- .../data/elasticsearch/client/elc/ResponseConverter.java | 2 +- .../client/elc/SearchDocumentResponseBuilder.java | 2 +- .../data/elasticsearch/client/elc/TypeUtils.java | 2 +- .../client/elc/aot/ElasticsearchClientRuntimeHints.java | 2 +- .../data/elasticsearch/client/elc/package-info.java | 2 +- .../data/elasticsearch/client/util/ScrollState.java | 2 +- .../config/ElasticsearchAuditingBeanDefinitionParser.java | 2 +- .../config/ElasticsearchAuditingRegistrar.java | 2 +- .../config/ElasticsearchConfigurationSupport.java | 2 +- .../config/ElasticsearchNamespaceHandler.java | 2 +- .../elasticsearch/config/EnableElasticsearchAuditing.java | 2 +- .../config/EnableReactiveElasticsearchAuditing.java | 2 +- .../config/PersistentEntitiesFactoryBean.java | 2 +- .../config/ReactiveElasticsearchAuditingRegistrar.java | 2 +- .../elasticsearch/core/AbstractElasticsearchTemplate.java | 2 +- .../core/AbstractReactiveElasticsearchTemplate.java | 2 +- .../data/elasticsearch/core/ActiveShardCount.java | 2 +- .../data/elasticsearch/core/AggregationContainer.java | 2 +- .../data/elasticsearch/core/AggregationsContainer.java | 2 +- .../data/elasticsearch/core/DocumentOperations.java | 2 +- .../data/elasticsearch/core/ElasticsearchOperations.java | 2 +- .../data/elasticsearch/core/EntityOperations.java | 2 +- .../data/elasticsearch/core/IndexInformation.java | 2 +- .../data/elasticsearch/core/IndexOperations.java | 2 +- .../data/elasticsearch/core/IndexOperationsAdapter.java | 2 +- .../data/elasticsearch/core/IndexedObjectInformation.java | 2 +- .../data/elasticsearch/core/MultiGetItem.java | 2 +- .../elasticsearch/core/ReactiveDocumentOperations.java | 2 +- .../core/ReactiveElasticsearchOperations.java | 2 +- .../data/elasticsearch/core/ReactiveIndexOperations.java | 2 +- .../data/elasticsearch/core/ReactiveResourceUtil.java | 2 +- .../data/elasticsearch/core/ReactiveSearchHitSupport.java | 2 +- .../data/elasticsearch/core/ReactiveSearchHits.java | 2 +- .../data/elasticsearch/core/ReactiveSearchHitsImpl.java | 2 +- .../data/elasticsearch/core/ReactiveSearchOperations.java | 2 +- .../data/elasticsearch/core/RefreshPolicy.java | 2 +- .../data/elasticsearch/core/ResourceUtil.java | 2 +- .../data/elasticsearch/core/SearchHit.java | 2 +- .../data/elasticsearch/core/SearchHitMapping.java | 2 +- .../data/elasticsearch/core/SearchHitSupport.java | 2 +- .../data/elasticsearch/core/SearchHits.java | 2 +- .../data/elasticsearch/core/SearchHitsImpl.java | 2 +- .../data/elasticsearch/core/SearchHitsIterator.java | 2 +- .../data/elasticsearch/core/SearchOperations.java | 2 +- .../data/elasticsearch/core/SearchPage.java | 2 +- .../data/elasticsearch/core/SearchScrollHits.java | 4 ++-- .../data/elasticsearch/core/SearchShardStatistics.java | 2 +- .../data/elasticsearch/core/StreamQueries.java | 2 +- .../data/elasticsearch/core/TotalHitsRelation.java | 2 +- .../data/elasticsearch/core/cluster/ClusterHealth.java | 2 +- .../elasticsearch/core/cluster/ClusterOperations.java | 2 +- .../core/cluster/ReactiveClusterOperations.java | 2 +- .../core/convert/AbstractPropertyValueConverter.java | 2 +- .../core/convert/AbstractRangePropertyValueConverter.java | 2 +- .../elasticsearch/core/convert/ConversionException.java | 2 +- .../data/elasticsearch/core/convert/DateFormatter.java | 8 ++++---- .../core/convert/DatePropertyValueConverter.java | 2 +- .../core/convert/DateRangePropertyValueConverter.java | 2 +- .../core/convert/DefaultElasticsearchTypeMapper.java | 2 +- .../core/convert/ElasticsearchConverter.java | 2 +- .../core/convert/ElasticsearchCustomConversions.java | 2 +- .../core/convert/ElasticsearchDateConverter.java | 2 +- .../core/convert/ElasticsearchTypeMapper.java | 2 +- .../data/elasticsearch/core/convert/GeoConverters.java | 2 +- .../core/convert/MappingConversionException.java | 2 +- .../core/convert/MappingElasticsearchConverter.java | 2 +- .../core/convert/NumberRangePropertyValueConverter.java | 2 +- .../core/convert/TemporalPropertyValueConverter.java | 2 +- .../core/convert/TemporalRangePropertyValueConverter.java | 2 +- .../data/elasticsearch/core/document/Document.java | 2 +- .../data/elasticsearch/core/document/Explanation.java | 2 +- .../data/elasticsearch/core/document/MapDocument.java | 2 +- .../data/elasticsearch/core/document/NestedMetaData.java | 2 +- .../data/elasticsearch/core/document/SearchDocument.java | 2 +- .../core/document/SearchDocumentAdapter.java | 2 +- .../core/document/SearchDocumentResponse.java | 2 +- .../elasticsearch/core/event/AfterConvertCallback.java | 2 +- .../data/elasticsearch/core/event/AfterLoadCallback.java | 2 +- .../data/elasticsearch/core/event/AfterSaveCallback.java | 2 +- .../elasticsearch/core/event/AuditingEntityCallback.java | 2 +- .../elasticsearch/core/event/BeforeConvertCallback.java | 4 ++-- .../core/event/ReactiveAfterConvertCallback.java | 2 +- .../core/event/ReactiveAfterLoadCallback.java | 2 +- .../core/event/ReactiveAfterSaveCallback.java | 2 +- .../core/event/ReactiveAuditingEntityCallback.java | 2 +- .../core/event/ReactiveBeforeConvertCallback.java | 4 ++-- .../data/elasticsearch/core/geo/GeoBox.java | 2 +- .../data/elasticsearch/core/geo/GeoJson.java | 2 +- .../elasticsearch/core/geo/GeoJsonGeometryCollection.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonLineString.java | 2 +- .../elasticsearch/core/geo/GeoJsonMultiLineString.java | 4 ++-- .../data/elasticsearch/core/geo/GeoJsonMultiPoint.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonMultiPolygon.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonPoint.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonPolygon.java | 2 +- .../data/elasticsearch/core/geo/GeoPoint.java | 2 +- .../data/elasticsearch/core/index/AliasAction.java | 2 +- .../elasticsearch/core/index/AliasActionParameters.java | 2 +- .../data/elasticsearch/core/index/AliasActions.java | 2 +- .../data/elasticsearch/core/index/AliasData.java | 2 +- .../core/index/ComponentTemplateRequestData.java | 2 +- .../core/index/DeleteComponentTemplateRequest.java | 2 +- .../core/index/DeleteIndexTemplateRequest.java | 2 +- .../elasticsearch/core/index/DeleteTemplateRequest.java | 2 +- .../core/index/ExistsComponentTemplateRequest.java | 2 +- .../core/index/ExistsIndexTemplateRequest.java | 2 +- .../elasticsearch/core/index/ExistsTemplateRequest.java | 2 +- .../core/index/GeoShapeMappingParameters.java | 2 +- .../core/index/GetComponentTemplateRequest.java | 2 +- .../elasticsearch/core/index/GetIndexTemplateRequest.java | 2 +- .../data/elasticsearch/core/index/GetTemplateRequest.java | 2 +- .../data/elasticsearch/core/index/MappingBuilder.java | 2 +- .../data/elasticsearch/core/index/MappingParameters.java | 2 +- .../core/index/PutComponentTemplateRequest.java | 2 +- .../elasticsearch/core/index/PutIndexTemplateRequest.java | 2 +- .../data/elasticsearch/core/index/PutTemplateRequest.java | 2 +- .../elasticsearch/core/index/ReactiveMappingBuilder.java | 2 +- .../data/elasticsearch/core/index/Settings.java | 2 +- .../data/elasticsearch/core/index/TemplateData.java | 2 +- .../data/elasticsearch/core/index/TemplateResponse.java | 2 +- .../elasticsearch/core/index/TemplateResponseData.java | 2 +- .../data/elasticsearch/core/join/JoinField.java | 2 +- .../data/elasticsearch/core/mapping/Alias.java | 2 +- .../elasticsearch/core/mapping/CreateIndexSettings.java | 2 +- .../core/mapping/ElasticsearchPersistentEntity.java | 2 +- .../core/mapping/ElasticsearchPersistentProperty.java | 2 +- .../core/mapping/ElasticsearchSimpleTypes.java | 2 +- .../data/elasticsearch/core/mapping/IndexCoordinates.java | 2 +- .../core/mapping/KebabCaseFieldNamingStrategy.java | 2 +- .../core/mapping/PropertyValueConverter.java | 2 +- .../core/mapping/SimpleElasticsearchMappingContext.java | 2 +- .../core/mapping/SimpleElasticsearchPersistentEntity.java | 2 +- .../mapping/SimpleElasticsearchPersistentProperty.java | 2 +- .../data/elasticsearch/core/query/BaseQuery.java | 2 +- .../data/elasticsearch/core/query/BaseQueryBuilder.java | 2 +- .../data/elasticsearch/core/query/BulkOptions.java | 2 +- .../data/elasticsearch/core/query/ByQueryResponse.java | 2 +- .../data/elasticsearch/core/query/Criteria.java | 2 +- .../data/elasticsearch/core/query/CriteriaQuery.java | 2 +- .../elasticsearch/core/query/CriteriaQueryBuilder.java | 2 +- .../data/elasticsearch/core/query/DeleteQuery.java | 2 +- .../data/elasticsearch/core/query/DocValueField.java | 2 +- .../data/elasticsearch/core/query/FetchSourceFilter.java | 2 +- .../core/query/FetchSourceFilterBuilder.java | 2 +- .../data/elasticsearch/core/query/Field.java | 2 +- .../data/elasticsearch/core/query/GeoDistanceOrder.java | 2 +- .../data/elasticsearch/core/query/HasChildQuery.java | 2 +- .../data/elasticsearch/core/query/HasParentQuery.java | 2 +- .../data/elasticsearch/core/query/HighlightQuery.java | 2 +- .../data/elasticsearch/core/query/IndexBoost.java | 2 +- .../data/elasticsearch/core/query/IndexQuery.java | 2 +- .../data/elasticsearch/core/query/IndexQueryBuilder.java | 2 +- .../data/elasticsearch/core/query/IndicesOptions.java | 2 +- .../data/elasticsearch/core/query/InnerHitsQuery.java | 2 +- .../data/elasticsearch/core/query/MoreLikeThisQuery.java | 2 +- .../data/elasticsearch/core/query/Order.java | 2 +- .../data/elasticsearch/core/query/Query.java | 2 +- .../data/elasticsearch/core/query/RescorerQuery.java | 2 +- .../data/elasticsearch/core/query/RuntimeField.java | 2 +- .../data/elasticsearch/core/query/ScriptData.java | 2 +- .../data/elasticsearch/core/query/ScriptType.java | 2 +- .../data/elasticsearch/core/query/ScriptedField.java | 2 +- .../elasticsearch/core/query/SearchTemplateQuery.java | 2 +- .../core/query/SearchTemplateQueryBuilder.java | 2 +- .../data/elasticsearch/core/query/SeqNoPrimaryTerm.java | 2 +- .../data/elasticsearch/core/query/SimpleField.java | 2 +- .../data/elasticsearch/core/query/SourceFilter.java | 2 +- .../data/elasticsearch/core/query/SqlQuery.java | 2 +- .../data/elasticsearch/core/query/StringQuery.java | 2 +- .../data/elasticsearch/core/query/StringQueryBuilder.java | 2 +- .../data/elasticsearch/core/query/UpdateQuery.java | 2 +- .../data/elasticsearch/core/query/UpdateResponse.java | 2 +- .../elasticsearch/core/query/highlight/Highlight.java | 2 +- .../core/query/highlight/HighlightCommonParameters.java | 2 +- .../core/query/highlight/HighlightField.java | 2 +- .../core/query/highlight/HighlightFieldParameters.java | 2 +- .../core/query/highlight/HighlightParameters.java | 2 +- .../elasticsearch/core/query/highlight/package-info.java | 2 +- .../elasticsearch/core/query/types/ConflictsType.java | 2 +- .../data/elasticsearch/core/query/types/OperatorType.java | 2 +- .../data/elasticsearch/core/reindex/ReindexRequest.java | 2 +- .../data/elasticsearch/core/reindex/ReindexResponse.java | 2 +- .../data/elasticsearch/core/reindex/Remote.java | 2 +- .../core/script/ReactiveScriptOperations.java | 2 +- .../data/elasticsearch/core/script/Script.java | 2 +- .../data/elasticsearch/core/script/ScriptOperations.java | 2 +- .../elasticsearch/core/sql/ReactiveSqlOperations.java | 2 +- .../data/elasticsearch/core/sql/SqlOperations.java | 2 +- .../data/elasticsearch/core/sql/SqlResponse.java | 2 +- .../data/elasticsearch/core/suggest/Completion.java | 2 +- .../data/elasticsearch/core/suggest/package-info.java | 2 +- .../core/suggest/response/CompletionSuggestion.java | 2 +- .../core/suggest/response/PhraseSuggestion.java | 2 +- .../data/elasticsearch/core/suggest/response/SortBy.java | 2 +- .../data/elasticsearch/core/suggest/response/Suggest.java | 2 +- .../core/suggest/response/TermSuggestion.java | 2 +- .../elasticsearch/repository/ElasticsearchRepository.java | 2 +- .../repository/ReactiveElasticsearchRepository.java | 2 +- .../repository/aot/RepositoryRuntimeHints.java | 2 +- .../repository/cdi/ElasticsearchRepositoryBean.java | 2 +- .../repository/cdi/ElasticsearchRepositoryExtension.java | 2 +- .../config/ElasticsearchRepositoriesRegistrar.java | 2 +- .../config/ElasticsearchRepositoryConfigExtension.java | 2 +- .../config/EnableElasticsearchRepositories.java | 2 +- .../config/EnableReactiveElasticsearchRepositories.java | 2 +- .../ReactiveElasticsearchRepositoriesRegistrar.java | 2 +- ...tiveElasticsearchRepositoryConfigurationExtension.java | 2 +- .../query/AbstractElasticsearchRepositoryQuery.java | 2 +- .../AbstractReactiveElasticsearchRepositoryQuery.java | 2 +- .../repository/query/ElasticsearchEntityMetadata.java | 2 +- .../repository/query/ElasticsearchParameter.java | 2 +- .../repository/query/ElasticsearchParameterAccessor.java | 2 +- .../repository/query/ElasticsearchParameters.java | 2 +- .../query/ElasticsearchParametersParameterAccessor.java | 2 +- .../repository/query/ElasticsearchPartQuery.java | 2 +- .../repository/query/ElasticsearchQueryMethod.java | 2 +- .../repository/query/ElasticsearchStringQuery.java | 2 +- .../repository/query/HighlightConverter.java | 2 +- .../ReactiveElasticsearchParametersParameterAccessor.java | 2 +- .../query/ReactiveElasticsearchQueryExecution.java | 2 +- .../query/ReactiveElasticsearchQueryMethod.java | 2 +- .../query/ReactiveElasticsearchStringQuery.java | 2 +- .../query/ReactivePartTreeElasticsearchQuery.java | 2 +- .../query/SimpleElasticsearchEntityMetadata.java | 2 +- .../query/parser/ElasticsearchQueryCreator.java | 2 +- .../support/ElasticsearchEntityInformation.java | 2 +- .../support/ElasticsearchEntityInformationCreator.java | 2 +- .../ElasticsearchEntityInformationCreatorImpl.java | 2 +- .../support/ElasticsearchRepositoryFactory.java | 2 +- .../support/ElasticsearchRepositoryFactoryBean.java | 2 +- .../support/ElasticsearchRepositoryMetadata.java | 2 +- .../support/MappingElasticsearchEntityInformation.java | 2 +- .../support/QueryStringPlaceholderReplacer.java | 2 +- .../repository/support/QueryStringProcessor.java | 2 +- .../support/ReactiveElasticsearchRepositoryFactory.java | 2 +- .../ReactiveElasticsearchRepositoryFactoryBean.java | 2 +- .../support/ReactiveElasticsearchRepositoryMetadata.java | 2 +- .../repository/support/SimpleElasticsearchRepository.java | 2 +- .../support/SimpleReactiveElasticsearchRepository.java | 2 +- .../support/querybyexample/ExampleCriteriaMapper.java | 2 +- .../QueryByExampleElasticsearchExecutor.java | 2 +- .../ReactiveQueryByExampleElasticsearchExecutor.java | 2 +- .../repository/support/spel/QueryStringSpELEvaluator.java | 2 +- .../ElasticsearchCollectionValueToStringConverter.java | 2 +- .../value/ElasticsearchQueryValueConversionService.java | 2 +- .../value/ElasticsearchStringValueToStringConverter.java | 2 +- .../elasticsearch/support/DefaultStringObjectMap.java | 2 +- .../data/elasticsearch/support/ExceptionUtils.java | 2 +- .../data/elasticsearch/support/HttpHeaders.java | 2 +- .../data/elasticsearch/support/ScoreDoc.java | 2 +- .../data/elasticsearch/support/StringObjectMap.java | 2 +- .../data/elasticsearch/support/Version.java | 2 +- .../data/elasticsearch/support/VersionInfo.java | 2 +- .../data/elasticsearch/utils/geohash/BitUtil.java | 2 +- .../data/elasticsearch/utils/geohash/Geohash.java | 2 +- .../data/elasticsearch/utils/geohash/Geometry.java | 2 +- .../elasticsearch/utils/geohash/GeometryValidator.java | 2 +- .../data/elasticsearch/utils/geohash/GeometryVisitor.java | 2 +- .../data/elasticsearch/utils/geohash/Point.java | 2 +- .../data/elasticsearch/utils/geohash/Rectangle.java | 2 +- .../data/elasticsearch/utils/geohash/ShapeType.java | 2 +- .../elasticsearch/utils/geohash/StandardValidator.java | 2 +- .../data/elasticsearch/utils/geohash/WellKnownText.java | 2 +- .../data/elasticsearch/utils/geohash/package-info.java | 2 +- .../data/elasticsearch/core/SearchOperationsExtensions.kt | 2 +- .../repository/CoroutineElasticsearchRepository.kt | 2 +- src/test/java/org/elasticsearch/bootstrap/JarHell.java | 2 +- .../data/elasticsearch/BulkFailureExceptionTest.java | 2 +- .../data/elasticsearch/DocumentUnitTests.java | 2 +- .../data/elasticsearch/JUnit5ClusterConnectionTests.java | 2 +- .../JUnit5SampleElasticsearchTemplateTests.java | 2 +- .../data/elasticsearch/JUnit5SampleReactiveELCTests.java | 2 +- .../elasticsearch/NestedObjectELCIntegrationTests.java | 2 +- .../data/elasticsearch/NestedObjectIntegrationTests.java | 2 +- .../annotations/ComposableAnnotationsUnitTest.java | 2 +- .../client/ClientConfigurationUnitTests.java | 2 +- .../client/InetSocketAddressParserUnitTests.java | 2 +- .../data/elasticsearch/client/RestClientsTest.java | 2 +- .../client/elc/AutoCloseableElasticsearchClientTest.java | 2 +- .../client/elc/CriteriaQueryMappingUnitTests.java | 2 +- .../client/elc/CriteriaQueryProcessorUnitTests.java | 2 +- .../data/elasticsearch/client/elc/DevTests.java | 2 +- .../client/elc/DocumentAdaptersUnitTests.java | 2 +- .../data/elasticsearch/client/elc/ELCWiremockTests.java | 2 +- .../elc/ElasticsearchPartQueryELCIntegrationTests.java | 2 +- .../client/elc/ReactiveIndicesTemplateTest.java | 2 +- .../elasticsearch/client/elc/RequestConverterTest.java | 2 +- .../elc/SearchDocumentResponseBuilderUnitTests.java | 2 +- .../data/elasticsearch/client/util/ScrollStateTest.java | 2 +- .../elasticsearch/config/AuditingELCIntegrationTests.java | 2 +- .../elasticsearch/config/AuditingIntegrationTests.java | 2 +- .../config/AuditingReactiveELCIntegrationTests.java | 2 +- .../config/AuditingReactiveIntegrationTest.java | 2 +- .../config/ElasticsearchAuditingRegistrarUnitTests.java | 2 +- .../ElasticsearchConfigurationSupportUnitTests.java | 2 +- .../configuration/ElasticsearchConfigurationELCTests.java | 2 +- .../ReactiveElasticsearchConfigurationELCTests.java | 2 +- .../namespace/ElasticsearchNamespaceHandlerTests.java | 2 +- .../EnableNestedRepositoriesELCIntegrationTests.java | 2 +- .../nested/EnableNestedRepositoriesIntegrationTests.java | 2 +- .../notnested/EnableRepositoriesELCIntegrationTests.java | 2 +- .../notnested/EnableRepositoriesIntegrationTests.java | 2 +- .../config/notnested/SampleElasticsearchRepository.java | 2 +- .../notnested/SampleUUIDKeyedElasticsearchRepository.java | 2 +- .../core/ElasticsearchELCIntegrationTests.java | 2 +- .../elasticsearch/core/ElasticsearchIntegrationTests.java | 2 +- .../elasticsearch/core/IndexCoordinatesUnitTests.java | 2 +- .../elasticsearch/core/InnerHitsELCIntegrationTests.java | 2 +- .../elasticsearch/core/InnerHitsIntegrationTests.java | 2 +- .../elasticsearch/core/LogEntityELCIntegrationTests.java | 2 +- .../elasticsearch/core/LogEntityIntegrationTests.java | 2 +- .../data/elasticsearch/core/MappingContextBaseTests.java | 2 +- .../core/PointInTimeELCIntegrationTests.java | 2 +- .../elasticsearch/core/PointInTimeIntegrationTests.java | 2 +- .../core/ReactiveElasticsearchELCIntegrationTests.java | 2 +- .../core/ReactiveElasticsearchIntegrationTests.java | 2 +- .../core/ReactivePointInTimeELCIntegrationTests.java | 2 +- .../core/ReactivePointInTimeIntegrationTests.java | 2 +- .../core/ReactiveReindexELCIntegrationTests.java | 2 +- .../core/ReactiveReindexIntegrationTests.java | 2 +- .../data/elasticsearch/core/ReactiveResourceUtilTest.java | 2 +- .../core/ReactiveSearchTemplateELCIntegrationTests.java | 2 +- .../core/ReactiveSearchTemplateIntegrationTests.java | 2 +- .../elasticsearch/core/ReindexELCIntegrationTests.java | 2 +- .../data/elasticsearch/core/ReindexIntegrationTests.java | 2 +- .../core/SearchAsYouTypeELCIntegrationTests.java | 2 +- .../core/SearchAsYouTypeIntegrationTests.java | 2 +- .../data/elasticsearch/core/SearchHitSupportTest.java | 2 +- .../core/SearchTemplateELCIntegrationTests.java | 2 +- .../core/SearchTemplateIntegrationTests.java | 2 +- .../core/SourceFilterELCIntegrationTests.java | 2 +- .../elasticsearch/core/SourceFilterIntegrationTests.java | 2 +- .../data/elasticsearch/core/StreamQueriesTest.java | 2 +- .../core/aggregation/AggregationELCIntegrationTests.java | 2 +- .../core/aggregation/AggregationIntegrationTests.java | 2 +- .../cluster/ClusterOperationsELCIntegrationTests.java | 2 +- .../core/cluster/ClusterOperationsIntegrationTests.java | 2 +- .../ClusterOperationsReactiveELCIntegrationTests.java | 2 +- .../ClusterOperationsReactiveIntegrationTests.java | 2 +- .../convert/ElasticsearchCustomConversionsUnitTests.java | 2 +- .../core/convert/GeoConvertersUnitTests.java | 2 +- .../convert/MappingElasticsearchConverterUnitTests.java | 2 +- .../core/convert/PropertyValueConvertersUnitTests.java | 2 +- .../core/event/AuditingEntityCallbackTests.java | 2 +- .../core/event/CallbackELCIntegrationTests.java | 2 +- .../core/event/CallbackIntegrationTests.java | 2 +- .../core/event/ReactiveAuditingEntityCallbackTests.java | 2 +- .../core/event/ReactiveCallbackELCIntegrationTests.java | 2 +- .../core/event/ReactiveCallbackIntegrationTests.java | 2 +- .../elasticsearch/core/geo/GeoELCIntegrationTests.java | 2 +- .../data/elasticsearch/core/geo/GeoIntegrationTests.java | 2 +- .../core/geo/GeoJsonELCIntegrationTests.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonEntity.java | 2 +- .../core/geo/GeoJsonGeometryCollectionUnitTests.java | 2 +- .../elasticsearch/core/geo/GeoJsonIntegrationTests.java | 2 +- .../core/geo/GeoJsonLineStringUnitTests.java | 2 +- .../core/geo/GeoJsonMultiLineStringUnitTests.java | 2 +- .../core/geo/GeoJsonMultiPointUnitTests.java | 2 +- .../core/geo/GeoJsonMultiPolygonUnitTests.java | 2 +- .../elasticsearch/core/geo/GeoJsonPointUnitTests.java | 2 +- .../core/index/IndexOperationsELCIntegrationTests.java | 2 +- .../core/index/IndexOperationsIntegrationTests.java | 2 +- .../core/index/IndexTemplateELCIntegrationTests.java | 2 +- .../core/index/IndexTemplateIntegrationTests.java | 2 +- .../core/index/MappingBuilderELCIntegrationTests.java | 2 +- .../core/index/MappingBuilderIntegrationTests.java | 2 +- .../elasticsearch/core/index/MappingBuilderUnitTests.java | 2 +- .../index/ReactiveIndexOperationsELCIntegrationTests.java | 2 +- .../index/ReactiveIndexOperationsIntegrationTests.java | 2 +- .../index/ReactiveIndexTemplateELCIntegrationTests.java | 2 +- .../core/index/ReactiveIndexTemplateIntegrationTests.java | 2 +- .../core/index/ReactiveMappingBuilderUnitTests.java | 2 +- .../data/elasticsearch/core/index/SettingsUnitTests.java | 2 +- .../core/index/SimpleDynamicTemplatesMappingTests.java | 2 +- .../core/index/SimpleElasticsearchDateMappingTests.java | 2 +- .../EntityCustomConversionELCIntegrationTests.java | 2 +- .../mapping/EntityCustomConversionIntegrationTests.java | 2 +- .../mapping/FieldNamingStrategyELCIntegrationTests.java | 2 +- .../core/mapping/FieldNamingStrategyIntegrationTests.java | 2 +- .../ReactiveFieldNamingStrategyELCIntegrationTests.java | 2 +- .../ReactiveFieldNamingStrategyIntegrationTests.java | 2 +- .../mapping/SimpleElasticsearchPersistentEntityTests.java | 2 +- .../SimpleElasticsearchPersistentPropertyUnitTests.java | 2 +- .../ReactiveSearchAfterELCIntegrationTests.java | 2 +- .../paginating/ReactiveSearchAfterIntegrationTests.java | 2 +- .../core/paginating/SearchAfterELCIntegrationTests.java | 2 +- .../core/paginating/SearchAfterIntegrationTests.java | 2 +- .../core/query/CriteriaQueryELCIntegrationTests.java | 2 +- .../core/query/CriteriaQueryIntegrationTests.java | 2 +- .../query/ElasticsearchPartQueryIntegrationTests.java | 2 +- .../core/query/NativeQueryELCIntegrationTests.java | 2 +- .../core/query/NativeQueryIntegrationTests.java | 2 +- .../data/elasticsearch/core/query/RuntimeFieldTest.java | 2 +- .../elasticsearch/core/query/SeqNoPrimaryTermTests.java | 2 +- .../ReactiveScriptedAndRuntimeFieldsIntegrationTests.java | 2 +- .../ScriptedAndRuntimeFieldsELCIntegrationTests.java | 2 +- .../ScriptedAndRuntimeFieldsIntegrationTests.java | 2 +- .../core/query/sort/NestedSortIntegrationTests.java | 2 +- .../core/routing/ReactiveRoutingELCIntegrationTests.java | 2 +- .../core/sql/ReactiveSqlOperationsIntegrationTests.java | 2 +- .../core/sql/SqlOperationsIntegrationTests.java | 2 +- .../core/suggest/CompletionELCIntegrationTests.java | 2 +- .../core/suggest/CompletionIntegrationTests.java | 2 +- .../CompletionWithContextsELCIntegrationTests.java | 2 +- .../suggest/CompletionWithContextsIntegrationTests.java | 2 +- .../core/suggest/ReactiveSuggestELCIntegrationTests.java | 2 +- .../core/suggest/ReactiveSuggestIntegrationTests.java | 2 +- .../immutable/ImmutableRepositoryELCIntegrationTests.java | 2 +- .../immutable/ImmutableRepositoryIntegrationTests.java | 2 +- .../elasticsearch/junit/jupiter/ClusterConnection.java | 2 +- .../junit/jupiter/ClusterConnectionException.java | 2 +- .../junit/jupiter/ClusterConnectionInfo.java | 2 +- .../junit/jupiter/ElasticsearchTemplateConfiguration.java | 2 +- .../data/elasticsearch/junit/jupiter/IntegrationTest.java | 2 +- .../junit/jupiter/IntegrationtestEnvironment.java | 2 +- .../ReactiveElasticsearchTemplateConfiguration.java | 2 +- .../junit/jupiter/SpringDataElasticsearchExtension.java | 2 +- .../junit/jupiter/SpringIntegrationTest.java | 2 +- .../data/elasticsearch/junit/jupiter/Tags.java | 2 +- .../repositories/cdi/CdiProductRepository.java | 2 +- .../repositories/cdi/CdiRepositoryClient.java | 2 +- .../repositories/cdi/CdiRepositoryTests.java | 2 +- .../repositories/cdi/ElasticsearchOperationsProducer.java | 2 +- .../elasticsearch/repositories/cdi/OtherQualifier.java | 2 +- .../data/elasticsearch/repositories/cdi/PersonDB.java | 2 +- .../repositories/cdi/QualifiedProductRepository.java | 2 +- .../repositories/cdi/SamplePersonRepository.java | 2 +- .../repositories/cdi/SamplePersonRepositoryCustom.java | 2 +- .../repositories/cdi/SamplePersonRepositoryImpl.java | 2 +- .../ComplexCustomMethodRepositoryELCIntegrationTests.java | 2 +- .../ComplexCustomMethodRepositoryIntegrationTests.java | 2 +- .../autowiring/ComplexElasticsearchRepository.java | 2 +- .../autowiring/ComplexElasticsearchRepositoryCustom.java | 2 +- ...omMethodRepositoryManualWiringELCIntegrationTests.java | 2 +- ...ustomMethodRepositoryManualWiringIntegrationTests.java | 2 +- .../ComplexElasticsearchRepositoryManualWiring.java | 2 +- .../ComplexElasticsearchRepositoryManualWiringImpl.java | 2 +- .../CustomMethodRepositoryELCIntegrationTests.java | 2 +- .../CustomMethodRepositoryIntegrationTests.java | 2 +- .../repositories/custommethod/QueryParameter.java | 2 +- .../doubleid/DoubleIDRepositoryELCIntegrationTests.java | 2 +- .../doubleid/DoubleIDRepositoryIntegrationTests.java | 2 +- .../DynamicIndexEntityELCIntegrationTests.java | 2 +- .../dynamicindex/DynamicIndexEntityIntegrationTests.java | 2 +- .../geo/GeoRepositoryELCIntegrationTests.java | 2 +- .../repositories/geo/GeoRepositoryIntegrationTests.java | 2 +- .../integer/IntegerIDRepositoryELCIntegrationTests.java | 2 +- .../integer/IntegerIDRepositoryIntegrationTests.java | 2 +- .../repositories/knn/KnnSearchELCIntegrationTests.java | 2 +- .../repositories/knn/KnnSearchIntegrationTests.java | 2 +- .../nestedobject/InnerObjectIntegrationTests.java | 2 +- ...tingAndMappingEntityRepositoryELCIntegrationTests.java | 2 +- ...SettingAndMappingEntityRepositoryIntegrationTests.java | 2 +- ...DynamicMappingEntityRepositoryELCIntegrationTests.java | 2 +- ...eldDynamicMappingEntityRepositoryIntegrationTests.java | 2 +- .../repositories/spel/SpELEntityELCIntegrationTests.java | 2 +- .../repositories/spel/SpELEntityIntegrationTests.java | 2 +- .../synonym/SynonymRepositoryELCIntegrationTests.java | 2 +- .../synonym/SynonymRepositoryIntegrationTests.java | 2 +- .../UUIDElasticsearchRepositoryELCIntegrationTests.java | 2 +- .../UUIDElasticsearchRepositoryIntegrationTests.java | 2 +- .../ReactiveElasticsearchRepositoriesRegistrarTests.java | 2 +- ...icsearchRepositoryConfigurationExtensionUnitTests.java | 2 +- .../query/ElasticsearchQueryMethodUnitTests.java | 2 +- .../query/ElasticsearchStringQueryUnitTestBase.java | 2 +- .../query/ElasticsearchStringQueryUnitTests.java | 2 +- .../query/ReactiveElasticsearchQueryMethodUnitTests.java | 2 +- .../query/ReactiveElasticsearchStringQueryUnitTests.java | 2 +- .../query/keywords/QueryKeywordsELCIntegrationTests.java | 2 +- .../query/keywords/QueryKeywordsIntegrationTests.java | 2 +- .../ReactiveQueryKeywordsELCIntegrationTests.java | 2 +- .../keywords/ReactiveQueryKeywordsIntegrationTests.java | 2 +- .../ReactiveValueConverterELCIntegrationTests.java | 2 +- .../ReactiveValueConverterIntegrationTests.java | 2 +- .../valueconverter/ValueConverterELCIntegrationTests.java | 2 +- .../valueconverter/ValueConverterIntegrationTests.java | 2 +- .../ElasticsearchEntityInformationCreatorImplTests.java | 2 +- .../ElasticsearchRepositoryELCIntegrationTests.java | 2 +- .../support/ElasticsearchRepositoryIntegrationTests.java | 2 +- ...eactiveElasticsearchRepositoryELCIntegrationTests.java | 2 +- ...leReactiveElasticsearchRepositoryIntegrationTests.java | 2 +- ...ByExampleElasticsearchExecutorELCIntegrationTests.java | 2 +- ...eryByExampleElasticsearchExecutorIntegrationTests.java | 2 +- ...ByExampleElasticsearchExecutorELCIntegrationTests.java | 2 +- ...eryByExampleElasticsearchExecutorIntegrationTests.java | 2 +- .../support/DefaultStringObjectMapUnitTests.java | 2 +- .../data/elasticsearch/support/HttpHeadersTest.java | 2 +- .../data/elasticsearch/support/VersionInfoTest.java | 2 +- .../data/elasticsearch/support/VersionUnitTest.java | 2 +- .../data/elasticsearch/utils/IdGenerator.java | 2 +- .../data/elasticsearch/utils/IndexNameProvider.java | 2 +- .../query/CoroutineRepositoryELCIntegrationTests.kt | 2 +- .../query/CoroutineRepositoryIntegrationTests.kt | 2 +- 583 files changed, 591 insertions(+), 591 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java b/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java index 9308caa92..6d40bca63 100644 --- a/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java +++ b/src/main/java/org/springframework/data/elasticsearch/BulkFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java index 130f218f8..d0622bfa5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java +++ b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java b/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java index a431801aa..c1eab9bcf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java +++ b/src/main/java/org/springframework/data/elasticsearch/NoSuchIndexException.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java b/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java index 8dac09e1d..493d3b4b7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java +++ b/src/main/java/org/springframework/data/elasticsearch/ResourceFailureException.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java b/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java index 5ba76a6b2..5e97b4e00 100644 --- a/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java +++ b/src/main/java/org/springframework/data/elasticsearch/ResourceNotFoundException.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java b/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java index b743cc794..c70768609 100644 --- a/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java +++ b/src/main/java/org/springframework/data/elasticsearch/RestStatusException.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java index c04de263e..ca70b022b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java +++ b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/VersionConflictException.java b/src/main/java/org/springframework/data/elasticsearch/VersionConflictException.java index ea0267752..b3f31d355 100644 --- a/src/main/java/org/springframework/data/elasticsearch/VersionConflictException.java +++ b/src/main/java/org/springframework/data/elasticsearch/VersionConflictException.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java index 4017507f3..0f707e942 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Alias.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java index 6db4fd896..ea5d89529 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Aliases.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java index 3d93be01e..da27c1245 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java index 04401340d..94ca1ea72 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CompletionField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java b/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java index 0a0e80752..80bb7c15f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/CountQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java index 4e48e567a..9f3b7f9d7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/DateFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java index fbe761e4c..1131b2cd5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java index 23a82f384..9868c6e3c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Dynamic.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java index 0a9d4f463..97815477a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java index 93247b735..49271764b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldElementType.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java index f148efb63..f701948d6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/FieldType.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java index 73f23243e..7f07df55d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java index 7feda3823..05695abc9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoPointField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java index 0a3be4d2d..0121b07ee 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/GeoShapeField.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2024 the original author or authors. + * Copyright 2017-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java index 3b93f232d..30312ab43 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Highlight.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java index 73063b345..f6318be98 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightField.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java index 530c813ca..d4e8bbfd2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/HighlightParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java index 89637309a..2de226c7b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java index 76a481f73..01adc8fbb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexPrefixes.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java index 6fcb10213..4d76b9749 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/IndexedIndexName.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java index 46dae4d75..651bf5a82 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/InnerField.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java index 4e544bd4c..eb2e1e462 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java index fb1be2b68..2004200cf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/JoinTypeRelations.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java index 1eae1188d..6110e54be 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnAlgorithmType.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java index 48e27a45f..56d871d3b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnIndexOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java index 97a23aa35..d03c42a6f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/KnnSimilarity.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java index 4146824cf..c2d48c388 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Mapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/MappingAlias.java b/src/main/java/org/springframework/data/elasticsearch/annotations/MappingAlias.java index f71e664ee..791659e9d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/MappingAlias.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/MappingAlias.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java index 1523cd88b..9dff38c1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/MultiField.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java b/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java index 8707def77..a131b12a8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/NullValueType.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java index f5746a355..9f1b755c3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java index 51f31b3b2..926154f1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Setting.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java b/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java index 143996ea5..46cafd91a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Similarity.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java b/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java index 73f434999..055ecc616 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/SourceFilters.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java b/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java index 377ed9063..25de2cbca 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/TermVector.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java index 5e0726279..eb848bfed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/ValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ * Defines the class implementing the {@link PropertyValueConverter} interface. If this is a normal class, it must * provide a default constructor with no arguments. If this is an enum and thus implementing a singleton by enum it * must only have one enum value. - * + * * @return the class to use for conversion */ Class value(); diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java index 12ca0e1d2..7704450e2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteOnlyProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java index d62a704b7..86a844cc1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/WriteTypeHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java index 165c390b3..c3921b894 100644 --- a/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java +++ b/src/main/java/org/springframework/data/elasticsearch/aot/ElasticsearchAotPredicates.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java index 0dfbb146f..f135eaddd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java index ddc071026..bbd7e360b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java index 2eb55b770..247bc9be9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java index e5f50ed0e..d13f556c7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java index f422ecded..014acb632 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ElasticsearchHost.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java index e5d9cd1f2..33f71a49e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/InetSocketAddressParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java index 248776878..b8a560db6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/NoReachableHostException.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java index 1268ff326..0264b95c0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedBackendOperation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java index 112a03c78..322646bc6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/UnsupportedClientOperationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java index e8fc6f8b1..d882ddb1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java index ab46cad89..23e2b6ae4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/Aggregation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java index 9a074b4a2..3ce661e1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java index 633c858d4..4d3ebf5bd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ChildTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java index 44f3f7a51..fcba35fa7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ClusterTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java index 140f87ac5..702d8501b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaFilterProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java index 2d43553d5..cb6cccf97 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryException.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java index b5788ba72..51bc9bccd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java index 871ad36d3..5996bada3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java index 4a4b442b1..828e81bf4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregation.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java index 10633a0ec..4f257c3e3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java index 9bde4ada1..dc1e0701d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java index d7e2aa10d..dcb92f5cf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java index d331f36c1..286d6a9dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java index 28bcbeca7..93d26101a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java index 5cdd90d0b..224e9c671 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchExceptionTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java index 49a0b5a00..58230a3a2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java index b014f89ec..e54d13ea7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/EntityAsMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java index 183d622ba..6ef0ea506 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java index c46f1da0e..d4c087455 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java index 801e727d0..3260b5a79 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java index ee1978688..44540494b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java index 6887963da..1cdd15c04 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java index a0062bb9d..1d254cb27 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java index 60e02c1ba..8cdd00cb0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveChildTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java index b3b0acda0..3207fd511 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveClusterTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index c77159f38..bcae5acc8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java index bbe1177a9..5d4fbcef1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java index 6414fcb80..2506b59c0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java index f274f7c66..50b859423 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java index 0f661d594..c14bb4865 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchSqlClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index 38252231f..f2d2cc158 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java index d4c7a6e1b..0ac64fa12 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 20670bff3..aebd1cb1e 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 @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 be5e7f636..3ae621a20 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 @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java index b3b0ca7ba..f9afa4fad 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java index 62bb4eefd..43747f3a7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java index 41beee704..47fb2a8e1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java index 2b9dc4c08..8dc2f99df 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java index ddb7151ce..f901706c1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java index a730003ae..9152ed57b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java index 018079155..c77af25f1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java index 1010ad440..4a8d78b69 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java index 9cc4ea461..f7304fb56 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java b/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java index 2b17fe53d..7a416e548 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/EnableElasticsearchAuditing.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java b/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java index 02df6aecf..804dd09e3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/EnableReactiveElasticsearchAuditing.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java index 5a8730986..6bc684111 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/PersistentEntitiesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java index cecb2fe74..a25b6ba1a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ReactiveElasticsearchAuditingRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java index 4275e17f8..387d26e6b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java index 96e9018c3..efa91084f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java b/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java index 4751c9322..8b1a9c47d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ActiveShardCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java b/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java index fa35a78d8..2cf49b3f6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AggregationContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java b/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java index e6e3d0d73..d201d9ed8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AggregationsContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java index 1dd000543..84f855ef5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java index b1427bcc1..3bc75f2e4 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java index afc048d3d..07a7e61d1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java index f6ed2269a..11b03cadf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java index d09fb3861..d7e583a4d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java index 397f5146d..b8c1d371a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java index 1b4e34ad9..6bd25bc88 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java index 827ea83ac..ad7795e66 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java index f5b191501..4614f6d25 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java index 34679a9d5..1942fd659 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java index a4cc50c22..1c9a28c71 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java index 56671cd05..ddbc0d61c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java index f8d84b743..95a431e65 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java index e1b95eb54..c83ea8ea9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java index 7ab10eaf3..e932b38ae 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java index 1f533b60f..b620f4c58 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java b/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java index 356a67d8a..44e237720 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/RefreshPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java b/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java index 83184645b..93530c533 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java index a811d6f09..238d90b21 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java index 8d9689ae3..d636715f6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java index 2be5af566..d4e8b0441 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java index 363369a49..e41f4f521 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java index f8404b0e2..f3949787f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java index eb9c491b0..cff034fa3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java index f92bcc19c..934737dd5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java index fd07115aa..54089e2a4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchPage.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java index 463ddf6b5..7a47e3e6c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ * This interface is used to expose the current {@code scrollId} from the underlying scroll context. *

* Internal use only. - * + * * @author Sascha Woo * @author Peter-Josef Meisch * @param diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java index 10ddcdd94..293d2e7a0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java index 953607c20..62319e4b5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java b/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java index c82520223..33e2449b0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/TotalHitsRelation.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java index 8d79e1df4..70ab96571 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java index aa535d76a..c35c7c449 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java index 279a4be76..ca0feddb1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/ReactiveClusterOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java index 08f8b52d8..153a6feb1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractPropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java index fb05f4cb3..87606763b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/AbstractRangePropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java index a626fbbe9..c5ad77bdd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java index c163b31cd..f20834961 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,14 +19,14 @@ /** * Interface to convert from and to {@link TemporalAccessor}s. - * + * * @author Peter-Josef Meisch * @since 4.2 */ public interface DateFormatter { /** * Formats a {@link TemporalAccessor} into a String. - * + * * @param accessor must not be {@literal null} * @return the formatted String */ @@ -34,7 +34,7 @@ public interface DateFormatter { /** * Parses a String into a {@link TemporalAccessor}. - * + * * @param input the String to parse, must not be {@literal null} * @param type the class of T * @param the {@link TemporalAccessor} implementation diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java index 0af0cfa78..2696633d1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DatePropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java index 11c84f3ee..2c8732287 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DateRangePropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java index a2ab473c2..9fc8532e8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java index 587540c6d..8e1300547 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java index c79520c46..a573523b2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversions.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java index 5661f2224..9c5800b09 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java index 331c6ac1c..dc6a54f37 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java index b48654d61..b6ad5b4ed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java index 7f6cd7b59..9b06cc3f6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index 606c5b945..f196263d2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/NumberRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/NumberRangePropertyValueConverter.java index 412efc6cf..6a47f37f2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/NumberRangePropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/NumberRangePropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalPropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalPropertyValueConverter.java index 079f036ea..efc2ab53b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalPropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalPropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalRangePropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalRangePropertyValueConverter.java index b0d9cc853..f41107922 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalRangePropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/TemporalRangePropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java b/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java index c2328c25a..8c9917c60 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java b/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java index 15d9fa55c..48135b226 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java index 522e26c2c..669313195 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java b/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java index 46cfd1ef8..3294e7a6f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java index 4e22d45b3..d98c68524 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java index 557667504..e2549aada 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java index 9009bde01..8430aad56 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterConvertCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterConvertCallback.java index 27ce209d0..01c185d6c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterConvertCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterConvertCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterLoadCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterLoadCallback.java index bae1adec6..5d898f355 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterLoadCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterLoadCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterSaveCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterSaveCallback.java index 361b8ab17..37b41fc2a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/AfterSaveCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/AfterSaveCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallback.java index f42bdcd6a..26caf0f32 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/BeforeConvertCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/BeforeConvertCallback.java index e08c92090..52f0ca3d9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/BeforeConvertCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/BeforeConvertCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ public interface BeforeConvertCallback extends EntityCallback { /** * Callback method that will be invoked before an entity is persisted. Can return the same or a different instance of * the domain entity class. - * + * * @param entity the entity being converted * @param index must not be {@literal null}. * @return the entity to be converted diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterConvertCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterConvertCallback.java index 309b116c7..9a4273d71 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterConvertCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterConvertCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterLoadCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterLoadCallback.java index a0ee6784f..1e73244df 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterLoadCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterLoadCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterSaveCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterSaveCallback.java index bfcbe2eca..5a9c6dfe5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterSaveCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAfterSaveCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallback.java index bc2f9d752..4a471193f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveBeforeConvertCallback.java b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveBeforeConvertCallback.java index cfc12503c..48df60a78 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveBeforeConvertCallback.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/ReactiveBeforeConvertCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ public interface ReactiveBeforeConvertCallback extends EntityCallback { /** * Callback method that will be invoked before an entity is persisted. Can return the same or a different instance of * the domain entity class. - * + * * @param entity the entity being converted * @param index must not be {@literal null}. * @return the entity to be converted diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java index 802e57ca3..b1a570ff6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java index 2f9b6f3f4..20c312303 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollection.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollection.java index 6bb232e4c..ef67ec2c9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollection.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollection.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java index 56ce8c127..5c848e90b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java index 7be2ab9a6..dec613fa9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ /** * {@link GeoJsonMultiLineString} is defined as list of {@link GeoJsonLineString}s.
* Copied from Spring Data Mongodb - * + * * @author Christoph Strobl * @author Peter-Josef Meisch * @since 4.1 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java index 06e2a7201..d81e30f52 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygon.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygon.java index a34cd4be1..bcd46bc6f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygon.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygon.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java index 33e34460a..a7bca7e6e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java index bb873d4e7..ffc613b30 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java index 57a5a0156..ade1a5532 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoPoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java index 2269e13d3..5297b1982 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java index 9db8473d2..1b71a8aa0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java index 7270244f3d..44c3869c5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java index 924deb691..615de488c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java index 47fa323d4..b67d41114 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteComponentTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteComponentTemplateRequest.java index c586f16a4..81e90ef63 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteComponentTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteComponentTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteIndexTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteIndexTemplateRequest.java index 71545fd96..60d8f35cb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteIndexTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteIndexTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteTemplateRequest.java index 5b89f442f..8d11652e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/DeleteTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsComponentTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsComponentTemplateRequest.java index 134a739eb..13e42bd35 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsComponentTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsComponentTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsIndexTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsIndexTemplateRequest.java index 0933be08f..34da32b46 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsIndexTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsIndexTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsTemplateRequest.java index b13c2457a..d9119add8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ExistsTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java index d175caef1..e34da7b70 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/GetComponentTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/GetComponentTemplateRequest.java index 4c9efe49c..9dbdce161 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/GetComponentTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/GetComponentTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/GetIndexTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/GetIndexTemplateRequest.java index 0217dc2bf..ebdd1b5a6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/GetIndexTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/GetIndexTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/GetTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/GetTemplateRequest.java index c9de01625..3df81d560 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/GetTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/GetTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java index f37b047f1..6d839dfe4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java index 7875a7d5e..eeab36b2e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java index 5693e668b..1576823b0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java index 01c3a77d1..1df627d35 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java index f010a50a6..c18f5166c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java index 983cfcb2c..21bc2a170 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java b/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java index e3b096e07..4989146a9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java index bc780f41d..365a9118a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java index 8a942d427..10f9f0dfb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java index e90ade22f..7f6649e0e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java b/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java index bc00799a5..c6d589133 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java index 97bbfe464..69905d964 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java index b36c82f2f..92cb90d53 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java index 252376bed..3fd5579fe 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java index 2b9d6232e..ab4c12d3e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchSimpleTypes.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchSimpleTypes.java index 3d03f178f..300251a06 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchSimpleTypes.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchSimpleTypes.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java index e93d9d704..2cac5c76a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/IndexCoordinates.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/KebabCaseFieldNamingStrategy.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/KebabCaseFieldNamingStrategy.java index bf2303318..5811a066e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/KebabCaseFieldNamingStrategy.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/KebabCaseFieldNamingStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/PropertyValueConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/PropertyValueConverter.java index 79ab43138..9fb8cc382 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/PropertyValueConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/PropertyValueConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java index 2564a51ef..e69a90756 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java index fb2a12412..8df3ca637 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java index 8b32842b9..b7c7835ad 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java index 86e6fdc33..a174511c4 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java index a7d4bf25f..b9c9acc62 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java index 41837acbb..3c9ca4bc3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java index cf6d3269b..2cd40cd05 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java index 78b4996a3..03d7e1ef9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java index 86afa2050..195d29e0b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryBuilder.java index fd67cc3be..b2fc5139b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java index e8a29ea2b..d96fed8c7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java index 84be12c43..4ac86722f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java index ced12f407..ed3be0727 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java index d35d46a1f..689736511 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java index eb20dec05..77c8ea45c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/GeoDistanceOrder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/GeoDistanceOrder.java index 638f307b8..162eb57fa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/GeoDistanceOrder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/GeoDistanceOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java index e8e7885e8..5fe4d5a12 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java index 7331a2725..0d8f9fb73 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java index 379a97213..370afcd2c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java index 94ec1c0ac..6ed97562b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexBoost.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java index 73c662662..14871022f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java index cfde12fc7..8cc67b286 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndicesOptions.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndicesOptions.java index 7ced9cb52..dd8660197 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndicesOptions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndicesOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java index 42cbadf4a..d4a92954d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java index 4bc503b7a..57ce6ea34 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java index 5977110f0..a3eaad247 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java index 5087499c0..2a0dd17b7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java index 791582626..c35725d1e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java index fca9ec8fa..805883a5f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java index 3db9ac670..0bcb6ad20 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java index ddddb539d..1c6ceecab 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptedField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptedField.java index 687d19e53..2a30a3c2e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptedField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptedField.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java index 9255461fb..4b4999fb0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java index a2b55fa8b..78fa4c3ad 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTerm.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTerm.java index d47b07405..062312850 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTerm.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTerm.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java index ee2e0473e..e94374365 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java index ab01424b5..d981cf80b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java index dbee7ef86..f14f1738e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java index e0ce51e87..1b7a38147 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQueryBuilder.java index 90e40de43..f688bee78 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/StringQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/StringQueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java index b2daafd60..90f759749 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateResponse.java index 60fb1d030..da2687425 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/Highlight.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/Highlight.java index cba076074..7ebdeca96 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/Highlight.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/Highlight.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java index 1541d9f95..b8ae62201 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightField.java index 1b8cf0d99..43c87d2a9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightField.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightFieldParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightFieldParameters.java index 0e7103d10..2e14eb3c5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightFieldParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightFieldParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightParameters.java index 487818298..32209ef16 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java index 5e4366ac4..b9a2dac3f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/types/ConflictsType.java b/src/main/java/org/springframework/data/elasticsearch/core/query/types/ConflictsType.java index 5c55159dd..3c08b9adf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/types/ConflictsType.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/types/ConflictsType.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/types/OperatorType.java b/src/main/java/org/springframework/data/elasticsearch/core/query/types/OperatorType.java index 1135b3ac2..91575000e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/types/OperatorType.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/types/OperatorType.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java index b3582639e..bf32e67ec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java index baa7e9d21..dbb3e8cf4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java index 82ff011d1..6454b67f2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/ReactiveScriptOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/script/ReactiveScriptOperations.java index 2939a4350..bed2d3667 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/ReactiveScriptOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/ReactiveScriptOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java index b5bdb560e..b4c3d0372 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java index 185fcc134..8593293dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java index 6988026fa..c4a288f3a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java index 3c1b3fc69..359499a9e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java index e0a91c437..0ddc78abc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java index 918c2bf3e..88be836b3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java index a5e6b99f6..47463fc6a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java index 6f9c05934..94d93c80d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java index e437ec05c..ad50678d9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/SortBy.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/SortBy.java index f377bb365..3fda6cc51 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/SortBy.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/SortBy.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java index 03cec7b15..862d0ed44 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java index b2aef3f22..2e42bc00b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java index 9527cabfc..44331d72e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java index a00ebecc6..59ee81f30 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License", @Nullable RefreshPolicy refreshPolicy); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java index 35b8caf27..b86a7137c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java index 255ed2dc1..458a343a6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java index 7bc97fa72..cb7e50ad2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/ElasticsearchRepositoryExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java index 5f1d2f584..4f643ebab 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java index 7607ac623..b1caf1b3e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ElasticsearchRepositoryConfigExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java index 8109e8a71..120d0df50 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableElasticsearchRepositories.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableReactiveElasticsearchRepositories.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableReactiveElasticsearchRepositories.java index b56b27470..42e1534f0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableReactiveElasticsearchRepositories.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/EnableReactiveElasticsearchRepositories.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrar.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrar.java index d834115f0..485f322bd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrar.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtension.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtension.java index 5079290a4..6eb546eec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtension.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java index a8f744e37..4420c7e09 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java index cd87229b1..74d3e78d7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchEntityMetadata.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchEntityMetadata.java index 2b6c9b428..4e041b428 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchEntityMetadata.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchEntityMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameter.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameter.java index 7ffcb77a8..4f7039f94 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameterAccessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameterAccessor.java index 3b01e9705..fd3450919 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameterAccessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameterAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameters.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameters.java index dd736c41f..7b2e72469 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParametersParameterAccessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParametersParameterAccessor.java index 92f4992c4..7ff305511 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParametersParameterAccessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchParametersParameterAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java index cee8e00d2..f4bec2da9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index f030023f2..6b0f54311 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java index 1ba765a00..4bbbefab6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java index 8e74b0a30..843aadecd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchParametersParameterAccessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchParametersParameterAccessor.java index 9ec8b46a9..8688dcb0d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchParametersParameterAccessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchParametersParameterAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java index dab654c60..d66a0087e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java index 047a0756d..320ff5cf6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java index c15b4dfb2..3fbbfff53 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java index 1da8c29a6..1b16e2e5a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/SimpleElasticsearchEntityMetadata.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/SimpleElasticsearchEntityMetadata.java index 3ba461f12..86c51400f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/SimpleElasticsearchEntityMetadata.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/SimpleElasticsearchEntityMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java index ebb361880..e681d018d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java index 58d30d919..6e71c428c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java index 151699db8..fa9106143 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java index 122770bc9..c571e2920 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java index b7c5f29ec..321cbff34 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java index 87d7f7bec..e331fa60e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryMetadata.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryMetadata.java index 5f1a8e441..46cea4961 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java index 6d106ab5c..7c3152ed3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/MappingElasticsearchEntityInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringPlaceholderReplacer.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringPlaceholderReplacer.java index 7d93623cd..82bf414af 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringPlaceholderReplacer.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringPlaceholderReplacer.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java index 8ac45acb7..bf0080991 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java index d4f65a7aa..49e1e18fc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java index de810586f..b58bb3999 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryMetadata.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryMetadata.java index 295097547..29b540dd6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryMetadata.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index e4d1da6e2..e58d9cc76 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java index 94dc3a60c..1d9c116cf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java index 91332e408..cd3eefa92 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutor.java index 9001a888c..4386581bc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutor.java index 1dffcf85d..de6b1e07c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java index 66fe369b4..3d691d313 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java index 4179fa1a1..706e11de2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java index 5f276bc80..67540ee1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java index b336e075d..23b4a75de 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java b/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java index 0d94e9e28..a27aa036c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/ExceptionUtils.java b/src/main/java/org/springframework/data/elasticsearch/support/ExceptionUtils.java index 22c4729e0..4fcc56ffa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/ExceptionUtils.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/ExceptionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java b/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java index 61f01e5d8..464b7253e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java b/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java index d52090d2c..c5079133f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java b/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java index ecf92303e..0cb286c7d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/Version.java b/src/main/java/org/springframework/data/elasticsearch/support/Version.java index a4506e504..b8aae6a70 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/Version.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/Version.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java b/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java index 5d9255ff0..f9f85b6aa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/BitUtil.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/BitUtil.java index 06ddba1a1..175983a74 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/BitUtil.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/BitUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java index cc1f74e10..cf444bfc4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geohash.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geometry.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geometry.java index d53b572ba..0ca757d4f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geometry.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Geometry.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryValidator.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryValidator.java index 2a866f454..c06f3ddc1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryValidator.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryVisitor.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryVisitor.java index 6afabb2f1..e2daa0659 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryVisitor.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/GeometryVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Point.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Point.java index 8a849b076..7e979b365 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Point.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Point.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Rectangle.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Rectangle.java index af187bb88..c8145e7ab 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Rectangle.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/Rectangle.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/ShapeType.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/ShapeType.java index ad0597258..386fac749 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/ShapeType.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/ShapeType.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/StandardValidator.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/StandardValidator.java index a2b909a31..98659e7c7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/StandardValidator.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/StandardValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/WellKnownText.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/WellKnownText.java index c65944f75..1b72c579b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/WellKnownText.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/WellKnownText.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/package-info.java b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/package-info.java index 0f9a90ec4..dbcea229e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/utils/geohash/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/utils/geohash/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt b/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt index 4e3839d95..b71e4acf8 100644 --- a/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt +++ b/src/main/kotlin/org/springframework/data/elasticsearch/core/SearchOperationsExtensions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt b/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt index cd0bc24af..221db17db 100644 --- a/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt +++ b/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/elasticsearch/bootstrap/JarHell.java b/src/test/java/org/elasticsearch/bootstrap/JarHell.java index 8db87b0d6..a4369f3c6 100644 --- a/src/test/java/org/elasticsearch/bootstrap/JarHell.java +++ b/src/test/java/org/elasticsearch/bootstrap/JarHell.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/BulkFailureExceptionTest.java b/src/test/java/org/springframework/data/elasticsearch/BulkFailureExceptionTest.java index e086cc066..88743e447 100644 --- a/src/test/java/org/springframework/data/elasticsearch/BulkFailureExceptionTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/BulkFailureExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java index 279cb7467..d083be144 100644 --- a/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java b/src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java index 72433075c..acbe9bfbb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java index b48148fd3..363f93906 100644 --- a/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java b/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java index 53c6e5b7e..d5b6f48e1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectELCIntegrationTests.java index 3c29d8d3d..e99b5e72f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java index 433550a5d..991324cc8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java b/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java index d7dc516ac..e376c0beb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java index 3638e1eb0..aa61213a2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java index 8e3a56c86..8bbef09c1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java b/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java index 20c8b0dc2..f8c9b6e49 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClientTest.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClientTest.java index 83ae05750..279d64936 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClientTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/AutoCloseableElasticsearchClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java index ed44cacbd..88f984614 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessorUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessorUnitTests.java index c4d99f704..9ef5bd13f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java index 9d5a1f837..d80e08ce9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/DocumentAdaptersUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/DocumentAdaptersUnitTests.java index cb0af89f8..1b9e60339 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/DocumentAdaptersUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/DocumentAdaptersUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java index 84a8fb7ec..4e6c09230 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java index 94a9136a7..86b395840 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplateTest.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplateTest.java index d64c2aa91..8e44ef006 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplateTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java index 4f12438cd..a789eb4ad 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java index f5bbb1f7e..daa407045 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/client/util/ScrollStateTest.java b/src/test/java/org/springframework/data/elasticsearch/client/util/ScrollStateTest.java index b6dc4719e..562fc26c4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/util/ScrollStateTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/util/ScrollStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingELCIntegrationTests.java index fca9ec464..1b73f5dce 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java index 0552cad34..4ee583aaa 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveELCIntegrationTests.java index 8c0b2f509..30c514ad6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java index cd6e477a0..2dfaee370 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrarUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrarUnitTests.java index 226afc603..a2e5f3b5a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrarUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingRegistrarUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java index 9a828d790..3470b6a79 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupportUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java index 71e1cd3af..489daba24 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java index 0c9c8f5ca..a01485c99 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/namespace/ElasticsearchNamespaceHandlerTests.java b/src/test/java/org/springframework/data/elasticsearch/config/namespace/ElasticsearchNamespaceHandlerTests.java index 1989a601a..0472e4d63 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/namespace/ElasticsearchNamespaceHandlerTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/namespace/ElasticsearchNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesELCIntegrationTests.java index e546210d7..ca749ffe2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java index 31651a0cc..de50ad46e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2024 the original author or authors. + * Copyright 2015-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesELCIntegrationTests.java index e83a6fd2f..9a56b5952 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java index b27b7deaf..a40aa5eaa 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleElasticsearchRepository.java index 87241dadf..25bfb7c1f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleUUIDKeyedElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleUUIDKeyedElasticsearchRepository.java index ae95501dd..ec355e098 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleUUIDKeyedElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/SampleUUIDKeyedElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java index 09c775569..a88a36dbb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java index d10b5a91e..bac9a9b71 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java index 36a98577e..5a404f19e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/IndexCoordinatesUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsELCIntegrationTests.java index c0219db26..3d28a95c1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java index 8ea2991ad..1f50ee60f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java index 12c857ccb..3f9bd74b6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java index 10905363e..c189c6863 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/MappingContextBaseTests.java b/src/test/java/org/springframework/data/elasticsearch/core/MappingContextBaseTests.java index d74ab5472..fa54bf2c4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/MappingContextBaseTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/MappingContextBaseTests.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2024 the original author or authors. +/* Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeELCIntegrationTests.java index 3a3674dc4..ed1ccf162 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java index dff56565b..63ec4fec9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java index 548c87ac6..f6ead65ff 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java index 270e56cde..e39131dfa 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeELCIntegrationTests.java index 4232a7ffc..4cb9366e4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java index 161a11ca6..b6b269592 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexELCIntegrationTests.java index 7034417db..8c1843082 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java index bd2568be3..e1dddee38 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtilTest.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtilTest.java index 9ba6f5b5c..79c574b3d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtilTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtilTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateELCIntegrationTests.java index 118790de5..d049cf291 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java index f80bd48d7..7b3abbd9e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReindexELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReindexELCIntegrationTests.java index c66c94073..3d5264ea8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReindexELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReindexELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java index 1499455ab..03d2485ef 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeELCIntegrationTests.java index ad89eabaf..af8491465 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java index cb8d938b6..429abe919 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java index 3dd7a35cc..df0034470 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchHitSupportTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateELCIntegrationTests.java index 1d346fa12..0843de8ad 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java index a02684db2..e6339c208 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterELCIntegrationTests.java index d96039851..1084b0d02 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java index 321fcc419..11137ce88 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java b/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java index b9e6abfc8..f54356611 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/StreamQueriesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationELCIntegrationTests.java index 36141e41d..84020c194 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java index f087c6f58..ec6fa95fb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsELCIntegrationTests.java index e8705ca4c..3fdc0709f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsIntegrationTests.java index ff3de066c..ddf586108 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveELCIntegrationTests.java index 045d671c6..f4e839f02 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveIntegrationTests.java index 9cceacd9a..2644dbfe7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/cluster/ClusterOperationsReactiveIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversionsUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversionsUnitTests.java index cca1246da..7b584e661 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversionsUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchCustomConversionsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/GeoConvertersUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/GeoConvertersUnitTests.java index 41f382385..c251ed4ca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/GeoConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/GeoConvertersUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java index b2575f6ad..985a17ad3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java index 15c5dea5c..273e0cf42 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java index d9e2bc305..f3e0e2969 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackELCIntegrationTests.java index 7bf62117d..614331306 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java index 70c194e2a..991b31c6d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java index 4cd372885..d00a8d690 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackELCIntegrationTests.java index 913a8fb36..3dddd26a5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java index 6c1c6afbc..eb5f7f407 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java index ec24ac2ac..38990853b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java index a6406615a..20e3b6eb5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonELCIntegrationTests.java index ec492b873..e1476a43b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java index e6c1b6148..87c1fd095 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollectionUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollectionUnitTests.java index e0ea07eaa..da2dcb3e4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollectionUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonGeometryCollectionUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java index c6dd7f8cd..8a5e78903 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineStringUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineStringUnitTests.java index 6c54f3330..6eed5b7ce 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineStringUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineStringUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineStringUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineStringUnitTests.java index 65f168228..2f0030176 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineStringUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineStringUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPointUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPointUnitTests.java index eeebe06a8..2ea05ddbf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPointUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPointUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygonUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygonUnitTests.java index ffa458a89..bfa7949e2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygonUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPolygonUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPointUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPointUnitTests.java index b8606e7bf..36d47c47c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPointUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPointUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsELCIntegrationTests.java index f8175479e..9f4f64319 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java index b35a97bde..3e2c8101d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java index 385310a62..6476d5fc1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java index e7858f858..06209cc24 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java index 037d45b60..e717afb7e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index b4aaab0e9..36efe8182 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index e79472d8f..673d56b1f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java index e5cfd1251..b991e644a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java index 8afadbc71..ef892bc45 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java index 0c4dcc30b..07388144e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java index e64ce7e10..b832a3285 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java index be677119c..d9a944927 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/SettingsUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/SettingsUnitTests.java index 8b150a33a..e745f67b6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/SettingsUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/SettingsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java index 72acf8e33..2026a5815 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java index 0363a307f..f45158c93 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionELCIntegrationTests.java index e3c949d09..57f57d51a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java index cf483256e..9ad3d8337 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyELCIntegrationTests.java index 44c84440a..b9acc4a9f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java index 92a87cce7..2ee3e39ab 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyELCIntegrationTests.java index 08afd793d..abf40388c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java index 9f89e8b72..61f839cdf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java index c06f7666d..858ccaaa5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java index fa9a2367c..e723143cf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterELCIntegrationTests.java index 981413954..24c6df1a9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java index 547a413a7..62951e4c7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterELCIntegrationTests.java index 05123918c..f5a9ce8ec 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java index 2e0eca374..674a03162 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryELCIntegrationTests.java index 6c66817ad..63101772f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java index 8f8ca8f83..2d91462e1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java index 2ca4b46c9..d8501cb52 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryELCIntegrationTests.java index 81e7b714f..6bda9b7d5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java index a03bc9348..30a29af12 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/RuntimeFieldTest.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RuntimeFieldTest.java index ab598f0e9..7b34c21d8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/RuntimeFieldTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RuntimeFieldTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTermTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTermTests.java index c95118c35..4bc264b63 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTermTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/SeqNoPrimaryTermTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java index dc016eb84..b093d1246 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsELCIntegrationTests.java index a7b0c7bea..b9a2ad56e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java index e49d8381b..9d05a240c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java index 41a5e2c8d..513923554 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingELCIntegrationTests.java index 6a4b3c3a1..ba154127e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java index 62a872ac8..8d6ddcc4f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java index 2451b1f43..6e3ce29c9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java index 2f4e7ca20..041b9a093 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java index b4d5c2a57..fc52f8c5b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsELCIntegrationTests.java index ba82cc751..e3e130f0c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java index 1e62b5158..148b7183b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java index a5f144170..e46dee4f8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java index 794a0f28e..8a629516c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryELCIntegrationTests.java index bf22e425f..bd9e93ab5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java index a77bf541f..a6407d15e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java index 57badfdd2..2b2a6bf1e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionException.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionException.java index bf68703a6..8b17c8509 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionException.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java index 1f440520e..76c837783 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ElasticsearchTemplateConfiguration.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ElasticsearchTemplateConfiguration.java index 440c5c031..1de266c48 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ElasticsearchTemplateConfiguration.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ElasticsearchTemplateConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationTest.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationTest.java index c0e619ce7..4e7929812 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationtestEnvironment.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationtestEnvironment.java index 8aa1cfa1f..505aecc74 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationtestEnvironment.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/IntegrationtestEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ReactiveElasticsearchTemplateConfiguration.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ReactiveElasticsearchTemplateConfiguration.java index 134b02ac9..135ef1f98 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ReactiveElasticsearchTemplateConfiguration.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ReactiveElasticsearchTemplateConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringDataElasticsearchExtension.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringDataElasticsearchExtension.java index f47761510..ec9abeebd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringDataElasticsearchExtension.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringDataElasticsearchExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringIntegrationTest.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringIntegrationTest.java index 1c97cf601..7bad52bdb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringIntegrationTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/Tags.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/Tags.java index f5a9c3ab4..efeca7ccb 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/Tags.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/Tags.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java index da84e2ef9..35e8f4537 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiProductRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java index 3782b3463..e6b5536b2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java index 569ad7a35..a0b7cab66 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchOperationsProducer.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchOperationsProducer.java index 3f570b50e..74371fd68 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchOperationsProducer.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/ElasticsearchOperationsProducer.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java index 45a2e4d44..7bcb96403 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/OtherQualifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java index d772a662e..bd56b8fc5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/PersonDB.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java index 1b91fc933..689b96c6f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/QualifiedProductRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java index 5b29e7f1d..52b45564b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java index fefcfd4c4..7c3845c39 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java index cfea0c960..d2b345f8f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/SamplePersonRepositoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryELCIntegrationTests.java index ea1e08b1c..d488fd427 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java index 95def7d67..856efdf0a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepository.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepository.java index 974ef1700..062231b55 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepository.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepositoryCustom.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepositoryCustom.java index b04024997..ae81cf4b2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepositoryCustom.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexElasticsearchRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringELCIntegrationTests.java index a0a179ec1..601330635 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java index 182e6b76a..5f5490b49 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiring.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiring.java index 57eb30f66..686a572d6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiring.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiring.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiringImpl.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiringImpl.java index c83c16d84..b71e6e919 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiringImpl.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexElasticsearchRepositoryManualWiringImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java index 3bdd52e94..d57d469d3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2018-2024 the original author or authors. + * Copyright 2018-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java index 730c55116..1b19b0cbe 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/QueryParameter.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/QueryParameter.java index 86b842b58..7cac5dd15 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/QueryParameter.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/QueryParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryELCIntegrationTests.java index a56357162..692a973f7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryIntegrationTests.java index 1b7a1de71..a6a191f77 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/doubleid/DoubleIDRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityELCIntegrationTests.java index 79b7e4780..2fabf32ed 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityIntegrationTests.java index 7d8d0c42f..5f5160262 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/dynamicindex/DynamicIndexEntityIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryELCIntegrationTests.java index 652fe28fa..06de58ecc 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java index de031541c..4ab491863 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryELCIntegrationTests.java index 876c43c22..ea6f41f33 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryIntegrationTests.java index 215c8fc80..12712e9b4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/integer/IntegerIDRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java index 6edc3044d..3cbee4163 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java index e886c8d5f..2c7027c34 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2024-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java index 0ddfeb47d..90f3a2a10 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryELCIntegrationTests.java index 08ace88b2..1d808a83b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryIntegrationTests.java index 5dbfa09ac..c02318a21 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/dynamic/DynamicSettingAndMappingEntityRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryELCIntegrationTests.java index bfba0e65d..72eb6819c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryIntegrationTests.java index 0cfebd461..ac327d26b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/setting/fielddynamic/FieldDynamicMappingEntityRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityELCIntegrationTests.java index 51cc21648..4939f2176 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityIntegrationTests.java index 6b0791d56..a5c403991 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/spel/SpELEntityIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryELCIntegrationTests.java index 1cbe7e708..683a31cbd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java index 12939f636..ea418a2be 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryELCIntegrationTests.java index b145b0c4b..c507c2254 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java index b779eef35..00dae64e2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java index ee5d5ccc4..79b43c3e6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtensionUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtensionUnitTests.java index 216eeae76..2dc981dc6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtensionUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoryConfigurationExtensionUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java index 441cf1e80..abf2f4157 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java index 5bd221b5d..ef0f79cb7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java index 13ae5cb9c..c15612ff6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java index b35243271..84adf695d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java index e51674ab8..e5a9f626d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsELCIntegrationTests.java index 36d49f60e..8371384bd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java index 757484e73..442d49ea2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2024 the original author or authors. + * Copyright 2016-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsELCIntegrationTests.java index e06d8e0f5..7471d6471 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java index ae27c0416..a2a4c7443 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterELCIntegrationTests.java index 6f4b75c81..482dea83f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java index c896ff539..3d8044844 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterELCIntegrationTests.java index f2c19956b..6018bfaec 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java index 42802a4d0..6fdbfc75b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java index 1e74e478e..ff97fe748 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformationCreatorImplTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2024 the original author or authors. + * Copyright 2014-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryELCIntegrationTests.java index 43fdee7b4..51b05be02 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java index 1cb0d1bc6..7c037b823 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2024 the original author or authors. + * Copyright 2013-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java index 6f0de2d24..20a0ddff3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java index 2ade46a6d..c7b77e584 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2024 the original author or authors. + * Copyright 2019-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorELCIntegrationTests.java index 2e359bc2e..123884971 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java index 040c2ba84..9bace28ed 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorELCIntegrationTests.java index 9f12e4eec..7482bb488 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorELCIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java index ad50e9ea2..7593d5c25 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMapUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMapUnitTests.java index 841e82b69..a77682d36 100644 --- a/src/test/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMapUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMapUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java b/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java index fba000f70..e9a0a0452 100644 --- a/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2022-2024 the original author or authors. + * Copyright 2022-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/support/VersionInfoTest.java b/src/test/java/org/springframework/data/elasticsearch/support/VersionInfoTest.java index 5e3231c14..2571a41ca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/support/VersionInfoTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/support/VersionInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/support/VersionUnitTest.java b/src/test/java/org/springframework/data/elasticsearch/support/VersionUnitTest.java index 5104564a4..6e643d34e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/support/VersionUnitTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/support/VersionUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/utils/IdGenerator.java b/src/test/java/org/springframework/data/elasticsearch/utils/IdGenerator.java index 002681ff2..adffb8be6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/utils/IdGenerator.java +++ b/src/test/java/org/springframework/data/elasticsearch/utils/IdGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2024 the original author or authors. + * Copyright 2020-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java b/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java index 5a4820edd..dcc28c945 100644 --- a/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java +++ b/src/test/java/org/springframework/data/elasticsearch/utils/IndexNameProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2021-2024 the original author or authors. + * Copyright 2021-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryELCIntegrationTests.kt b/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryELCIntegrationTests.kt index ce00ebdd7..2bd6d5a0d 100644 --- a/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryELCIntegrationTests.kt +++ b/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryELCIntegrationTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryIntegrationTests.kt b/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryIntegrationTests.kt index 89a1dcf7d..2438aabb8 100644 --- a/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryIntegrationTests.kt +++ b/src/test/kotlin/org/springframework/data/elasticsearch/repository/query/CoroutineRepositoryIntegrationTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023-2024 the original author or authors. + * Copyright 2023-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 5568c7bbc40198787351ae19d981c30f08f42756 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 11 Jan 2025 13:21:55 +0100 Subject: [PATCH 066/131] Add IndexQuery.builder() method. Original Pull Request: #3041 Closes #3030 Signed-off-by: Peter-Josef Meisch --- .../data/elasticsearch/core/query/IndexQuery.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java index 14871022f..38e358bca 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java @@ -54,6 +54,13 @@ public IndexQuery(@Nullable String id, @Nullable Object object, @Nullable Long v this.indexName = indexName; } + /** + * @since 5.5 + */ + public static IndexQueryBuilder builder() { + return new IndexQueryBuilder(); + } + @Nullable public String getId() { return id; From cb77b328aea942e29b04ec5c7407cdae8e0b881b Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 8 Feb 2025 12:17:42 +0100 Subject: [PATCH 067/131] Add repository method support for search templates. Original Pull Request #3049 Closes #2997 Signed-off-by: Peter-Josef Meisch --- .../elasticsearch/elasticsearch-new.adoc | 2 + .../ROOT/pages/elasticsearch/misc.adoc | 3 +- .../elasticsearch-repository-queries.adoc | 42 ++++- .../migration-guide-5.4-5.5.adoc | 10 ++ .../annotations/SearchTemplateQuery.java | 42 +++++ .../query/SearchTemplateQueryBuilder.java | 24 ++- .../AbstractElasticsearchRepositoryQuery.java | 16 +- ...tReactiveElasticsearchRepositoryQuery.java | 2 +- .../query/ElasticsearchPartQuery.java | 39 +---- .../query/ElasticsearchQueryMethod.java | 38 ++++- .../query/ElasticsearchStringQuery.java | 44 +---- .../ReactiveElasticsearchStringQuery.java | 52 +----- ...ReactiveRepositorySearchTemplateQuery.java | 92 ++++++++++ .../query/ReactiveRepositoryStringQuery.java | 83 +++++++++ .../repository/query/RepositoryPartQuery.java | 75 +++++++++ .../query/RepositorySearchTemplateQuery.java | 86 ++++++++++ .../query/RepositoryStringQuery.java | 58 +++++++ .../ElasticsearchRepositoryFactory.java | 15 +- ...eactiveElasticsearchRepositoryFactory.java | 12 +- ...ticsearchPartQueryELCIntegrationTests.java | 4 +- ... RepositoryPartQueryIntegrationTests.java} | 8 +- .../ElasticsearchStringQueryUnitTestBase.java | 78 --------- .../ReactiveRepositoryQueryUnitTestsBase.java | 73 ++++++++ ...epositorySearchTemplateQueryUnitTests.java | 113 +++++++++++++ ...activeRepositoryStringQueryUnitTests.java} | 86 +++++++--- .../query/RepositoryQueryUnitTestsBase.java | 71 ++++++++ ...epositorySearchTemplateQueryUnitTests.java | 113 +++++++++++++ ...va => RepositoryStringQueryUnitTests.java} | 80 ++++++--- .../RepositoryStringQueryUnitTestsBase.java | 23 +++ ...iveRepositoryQueryELCIntegrationTests.java | 42 +++++ ...activeRepositoryQueryIntegrationTests.java | 159 ++++++++++++++++++ .../RepositoryQueryELCIntegrationTests.java | 38 +++++ .../RepositoryQueryIntegrationTests.java | 151 +++++++++++++++++ 33 files changed, 1482 insertions(+), 292 deletions(-) create mode 100644 src/main/java/org/springframework/data/elasticsearch/annotations/SearchTemplateQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java create mode 100644 src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java rename src/test/java/org/springframework/data/elasticsearch/core/query/{ElasticsearchPartQueryIntegrationTests.java => RepositoryPartQueryIntegrationTests.java} (98%) delete mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryQueryUnitTestsBase.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java rename src/test/java/org/springframework/data/elasticsearch/repository/query/{ReactiveElasticsearchStringQueryUnitTests.java => ReactiveRepositoryStringQueryUnitTests.java} (89%) create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryQueryUnitTestsBase.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java rename src/test/java/org/springframework/data/elasticsearch/repository/query/{ElasticsearchStringQueryUnitTests.java => RepositoryStringQueryUnitTests.java} (89%) create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTestsBase.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryELCIntegrationTests.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryELCIntegrationTests.java create mode 100644 src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.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 4f481f347..d4a1b35a2 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -3,7 +3,9 @@ [[new-features.5-5-0]] == New in Spring Data Elasticsearch 5.5 + * Upgrade to Elasticsearch 8.17.0. +* Add support for the `@SearchTemplateQuery` annotation on repository methods. [[new-features.5-4-0]] == New in Spring Data Elasticsearch 5.4 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/misc.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/misc.adoc index 36567cda4..7f3ac8f0f 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/misc.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/misc.adoc @@ -365,6 +365,8 @@ operations.putScript( <.> To use a search template in a search query, Spring Data Elasticsearch provides the `SearchTemplateQuery`, an implementation of the `org.springframework.data.elasticsearch.core.query.Query` interface. +NOTE: Although `SearchTemplateQuery` is an implementation of the `Query` interface, not all of the functionality provided by the base class is available for a `SearchTemplateQuery` like setting a `Pageable` or a `Sort`. Values for this functionality must be added to the stored script like shown in the following example for paging parameters. If these values are set on the `Query` object, they will be ignored. + In the following code, we will add a call using a search template query to a custom repository implementation (see xref:repositories/custom-implementations.adoc[]) as an example how this can be integrated into a repository call. @@ -449,4 +451,3 @@ var query = Query.findAll().addSort(Sort.by(order)); About the filter query: It is not possible to use a `CriteriaQuery` here, as this query would be converted into a Elasticsearch nested query which does not work in the filter context. So only `StringQuery` or `NativeQuery` can be used here. When using one of these, like the term query above, the Elasticsearch field names must be used, so take care, when these are redefined with the `@Field(name="...")` definition. For the definition of the order path and the nested paths, the Java entity property names should be used. - diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/repositories/elasticsearch-repository-queries.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/repositories/elasticsearch-repository-queries.adoc index b558e13bb..b22e17522 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/repositories/elasticsearch-repository-queries.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/repositories/elasticsearch-repository-queries.adoc @@ -10,7 +10,9 @@ The Elasticsearch module supports all basic query building feature as string que === Declared queries Deriving the query from the method name is not always sufficient and/or may result in unreadable method names. -In this case one might make use of the `@Query` annotation (see xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc#elasticsearch.query-methods.at-query[Using @Query Annotation] ). +In this case one might make use of the `@Query` annotation (see xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc#elasticsearch.query-methods.at-query[Using the @Query Annotation] ). + +Another possibility is the use of a search-template, (see xref:elasticsearch/repositories/elasticsearch-repository-queries.adoc#elasticsearch.query-methods.at-searchtemplate-query[Using the @SearchTemplateQuery Annotation] ). [[elasticsearch.query-methods.criterions]] == Query creation @@ -312,11 +314,13 @@ Repository methods can be defined to have the following return types for returni * `SearchPage` [[elasticsearch.query-methods.at-query]] -== Using @Query Annotation +== Using the @Query Annotation .Declare query on the method using the `@Query` annotation. ==== -The arguments passed to the method can be inserted into placeholders in the query string. The placeholders are of the form `?0`, `?1`, `?2` etc. for the first, second, third parameter and so on. +The arguments passed to the method can be inserted into placeholders in the query string. +The placeholders are of the form `?0`, `?1`, `?2` etc. for the first, second, third parameter and so on. + [source,java] ---- interface BookRepository extends ElasticsearchRepository { @@ -341,15 +345,20 @@ It will be sent to Easticsearch as value of the query element; if for example th } ---- ==== + .`@Query` annotation on a method taking a Collection argument ==== A repository method such as + [source,java] ---- @Query("{\"ids\": {\"values\": ?0 }}") List getByIds(Collection ids); ---- -would make an https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html[IDs query] to return all the matching documents. So calling the method with a `List` of `["id1", "id2", "id3"]` would produce the query body + +would make an https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html[IDs query] to return all the matching documents. +So calling the method with a `List` of `["id1", "id2", "id3"]` would produce the query body + [source,json] ---- { @@ -369,7 +378,6 @@ would make an https://www.elastic.co/guide/en/elasticsearch/reference/current/qu ==== https://docs.spring.io/spring-framework/reference/core/expressions.html[SpEL expression] is also supported when defining query in `@Query`. - [source,java] ---- interface BookRepository extends ElasticsearchRepository { @@ -411,6 +419,7 @@ If for example the function is called with the parameter _John_, it would produc .accessing parameter property. ==== Supposing that we have the following class as query parameter type: + [source,java] ---- public record QueryParameter(String value) { @@ -444,7 +453,9 @@ We can pass `new QueryParameter("John")` as the parameter now, and it will produ .accessing bean property. ==== -https://docs.spring.io/spring-framework/reference/core/expressions/language-ref/bean-references.html[Bean property] is also supported to access. Given that there is a bean named `queryParameter` of type `QueryParameter`, we can access the bean with symbol `@` rather than `#`, and there is no need to declare a parameter of type `QueryParameter` in the query method: +https://docs.spring.io/spring-framework/reference/core/expressions/language-ref/bean-references.html[Bean property] is also supported to access. +Given that there is a bean named `queryParameter` of type `QueryParameter`, we can access the bean with symbol `@` rather than `#`, and there is no need to declare a parameter of type `QueryParameter` in the query method: + [source,java] ---- interface BookRepository extends ElasticsearchRepository { @@ -493,6 +504,7 @@ interface BookRepository extends ElasticsearchRepository { NOTE: collection values should not be quoted when declaring the elasticsearch json query. A collection of `names` like `List.of("name1", "name2")` will produce the following terms query: + [source,json] ---- { @@ -532,6 +544,7 @@ interface BookRepository extends ElasticsearchRepository { Page findByName(Collection parameters, Pageable pageable); } ---- + This will extract all the `value` property values as a new `Collection` from `QueryParameter` collection, thus takes the same effect as above. ==== @@ -560,3 +573,20 @@ interface BookRepository extends ElasticsearchRepository { ---- ==== + +[[elasticsearch.query-methods.at-searchtemplate-query]] +== Using the @SearchTemplateQuery Annotation + +When using Elasticsearch search templates - (see xref:elasticsearch/misc.adoc#elasticsearch.misc.searchtemplates [Search Template support]) it is possible to specify that a repository method should use a template by adding the `@SearchTemplateQuery` annotation to that method. + +Let's assume that there is a search template stored with the name "book-by-title" and this template need a parameter named "title", then a repository method using that search template can be defined like this: + +[source,java] +---- +interface BookRepository extends ElasticsearchRepository { + @SearchTemplateQuery(id = "book-by-title") + SearchHits findByTitle(String title); +} +---- + +The parameters of the repository method are sent to the seacrh template as key/value pairs where the key is the parameter name and the value is taken from the actual value when the method is invoked. diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc index 6fe54134d..494f6601f 100644 --- a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc @@ -9,4 +9,14 @@ This section describes breaking changes from version 5.4.x to 5.5.x and how remo [[elasticsearch-migration-guide-5.4-5.5.deprecations]] == Deprecations +Some classes that probably are not used by a library user have been renamed, the classes with the old names are still there, but are deprecated: + +|=== +|old name|new name + +|ElasticsearchPartQuery|RepositoryPartQuery +|ElasticsearchStringQuery|RepositoryStringQuery +|ReactiveElasticsearchStringQuery|ReactiveRepositoryStringQuery +|=== + === Removals diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/SearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/annotations/SearchTemplateQuery.java new file mode 100644 index 000000000..f50675d97 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/SearchTemplateQuery.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.annotations; + +import org.springframework.data.annotation.QueryAnnotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Annotation to mark a repository method as a search template method. The annotation defines the search template id, + * the parameters for the search template are taken from the method's arguments. + * + * @author P.J. Meisch (pj.meisch@sothawo.com) + * @since 5.5 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE }) +@Documented +@QueryAnnotation +public @interface SearchTemplateQuery { + /** + * The id of the search template. Must not be empt or null. + */ + String id(); +} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java index 78fa4c3ad..a0b61e27e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java @@ -15,22 +15,22 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; - import java.util.Map; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.lang.Nullable; + /** * @author Peter-Josef Meisch * @since 5.1 */ public class SearchTemplateQueryBuilder extends BaseQueryBuilder { - @Nullable - private String id; + @Nullable private String id; @Nullable String source; - @Nullable - Map params; + @Nullable Map params; @Nullable public String getId() { @@ -62,6 +62,18 @@ public SearchTemplateQueryBuilder withParams(@Nullable Map param return this; } + @Override + public SearchTemplateQueryBuilder withSort(Sort sort) { + throw new IllegalArgumentException( + "sort is not supported in a searchtemplate query. Sort values must be defined in the stored template"); + } + + @Override + public SearchTemplateQueryBuilder withPageable(Pageable pageable) { + throw new IllegalArgumentException( + "paging is not supported in a searchtemplate query. from and size values must be defined in the stored template"); + } + @Override public SearchTemplateQuery build() { return new SearchTemplateQuery(this); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java index 4420c7e09..be7ca9f17 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java @@ -24,6 +24,7 @@ import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.DeleteQuery; import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; import org.springframework.data.repository.query.ParametersParameterAccessor; import org.springframework.data.repository.query.QueryMethod; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; @@ -114,11 +115,15 @@ public Object execute(Object[] parameters) { : PageRequest.of(0, DEFAULT_STREAM_BATCH_SIZE)); result = StreamUtils.createStreamFromIterator(elasticsearchOperations.searchForStream(query, clazz, index)); } else if (queryMethod.isCollectionQuery()) { - if (parameterAccessor.getPageable().isUnpaged()) { - int itemCount = (int) elasticsearchOperations.count(query, clazz, index); - query.setPageable(PageRequest.of(0, Math.max(1, itemCount))); + if (query instanceof SearchTemplateQuery) { + // we cannot get a count here, from and size would be in the template } else { - query.setPageable(parameterAccessor.getPageable()); + if (parameterAccessor.getPageable().isUnpaged()) { + int itemCount = (int) elasticsearchOperations.count(query, clazz, index); + query.setPageable(PageRequest.of(0, Math.max(1, itemCount))); + } else { + query.setPageable(parameterAccessor.getPageable()); + } } result = elasticsearchOperations.search(query, clazz, index); } else { @@ -137,7 +142,8 @@ public Query createQuery(Object[] parameters) { var query = createQuery(parameterAccessor); Assert.notNull(query, "unsupported query"); - queryMethod.addMethodParameter(query, parameterAccessor, elasticsearchOperations.getElasticsearchConverter(), + queryMethod.addSpecialMethodParameters(query, parameterAccessor, + elasticsearchOperations.getElasticsearchConverter(), evaluationContextProvider); return query; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java index 74d3e78d7..384743562 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java @@ -105,7 +105,7 @@ private Object execute(ElasticsearchParametersParameterAccessor parameterAccesso var query = createQuery(parameterAccessor); Assert.notNull(query, "unsupported query"); - queryMethod.addMethodParameter(query, parameterAccessor, elasticsearchOperations.getElasticsearchConverter(), + queryMethod.addSpecialMethodParameters(query, parameterAccessor, elasticsearchOperations.getElasticsearchConverter(), evaluationContextProvider); String indexName = queryMethod.getEntityInformation().getIndexName(); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java index f4bec2da9..c3efcd47d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java @@ -33,42 +33,11 @@ * @author Rasmus Faber-Espensen * @author Peter-Josef Meisch * @author Haibo Liu + * @deprecated since 5.5, use {@link RepositoryPartQuery} instead */ -public class ElasticsearchPartQuery extends AbstractElasticsearchRepositoryQuery { - - private final PartTree tree; - private final MappingContext mappingContext; - - public ElasticsearchPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, - QueryMethodEvaluationContextProvider evaluationContextProvider) { +@Deprecated(forRemoval = true) +public class ElasticsearchPartQuery extends RepositoryPartQuery { + public ElasticsearchPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider) { super(method, elasticsearchOperations, evaluationContextProvider); - this.tree = new PartTree(queryMethod.getName(), queryMethod.getResultProcessor().getReturnedType().getDomainType()); - this.mappingContext = elasticsearchConverter.getMappingContext(); - } - - @Override - public boolean isCountQuery() { - return tree.isCountProjection(); - } - - @Override - protected boolean isDeleteQuery() { - return tree.isDelete(); - } - - @Override - protected boolean isExistsQuery() { - return tree.isExistsProjection(); - } - - protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor accessor) { - - BaseQuery query = new ElasticsearchQueryCreator(tree, accessor, mappingContext).createQuery(); - - if (tree.getMaxResults() != null) { - query.setMaxResults(tree.getMaxResults()); - } - - return query; } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index 6b0f54311..6a3608bec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -28,6 +28,7 @@ import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.annotations.Highlight; import org.springframework.data.elasticsearch.annotations.Query; +import org.springframework.data.elasticsearch.annotations.SearchTemplateQuery; import org.springframework.data.elasticsearch.annotations.SourceFilters; import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.SearchHits; @@ -84,6 +85,7 @@ public class ElasticsearchQueryMethod extends QueryMethod { @Nullable private final Query queryAnnotation; @Nullable private final Highlight highlightAnnotation; @Nullable private final SourceFilters sourceFilters; + @Nullable private final SearchTemplateQuery searchTemplateQueryAnnotation; public ElasticsearchQueryMethod(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory factory, MappingContext, ElasticsearchPersistentProperty> mappingContext) { @@ -98,6 +100,7 @@ public ElasticsearchQueryMethod(Method method, RepositoryMetadata repositoryMeta this.highlightAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, Highlight.class); this.sourceFilters = AnnotatedElementUtils.findMergedAnnotation(method, SourceFilters.class); this.unwrappedReturnType = potentiallyUnwrapReturnTypeFor(repositoryMetadata, method); + this.searchTemplateQueryAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, SearchTemplateQuery.class); verifyCountQueryTypes(); } @@ -125,12 +128,16 @@ protected void verifyCountQueryTypes() { } } + /** + * @return if the method is annotated with the {@link Query} annotation. + */ public boolean hasAnnotatedQuery() { return this.queryAnnotation != null; } /** - * @return the query String. Must not be {@literal null} when {@link #hasAnnotatedQuery()} returns true + * @return the query String defined in the {@link Query} annotation. Must not be {@literal null} when + * {@link #hasAnnotatedQuery()} returns true. */ @Nullable public String getAnnotatedQuery() { @@ -158,6 +165,27 @@ public HighlightQuery getAnnotatedHighlightQuery(HighlightConverter highlightCon return new HighlightQuery(highlightConverter.convert(highlightAnnotation), getDomainClass()); } + /** + * @return if the method is annotated with the {@link SearchTemplateQuery} annotation. + * @since 5.5 + */ + public boolean hasAnnotatedSearchTemplateQuery() { + return this.searchTemplateQueryAnnotation != null; + } + + /** + * @return the {@link SearchTemplateQuery} annotation + * @throws IllegalArgumentException if no {@link SearchTemplateQuery} annotation is present on the method + * @since 5.5 + */ + public SearchTemplateQuery getAnnotatedSearchTemplateQuery() { + + Assert.isTrue(hasAnnotatedSearchTemplateQuery(), "no SearchTemplateQuery annotation present on " + getName()); + Assert.notNull(searchTemplateQueryAnnotation, "highlsearchTemplateQueryAnnotationightAnnotation must not be null"); + + return searchTemplateQueryAnnotation; + } + /** * @return the {@link ElasticsearchEntityMetadata} for the query methods {@link #getReturnedObjectType() return type}. * @since 3.2 @@ -281,7 +309,7 @@ public boolean isNotSearchPageMethod() { /** * @return {@literal true} if the method is annotated with - * {@link org.springframework.data.elasticsearch.annotations.CountQuery} or with {@link Query}(count =true) + * {@link org.springframework.data.elasticsearch.annotations.CountQuery} or with {@link Query}(count = true) * @since 4.2 */ public boolean hasCountQueryAnnotation() { @@ -377,9 +405,9 @@ private Class potentiallyUnwrapReturnTypeFor(RepositoryMetadata metadata, Met } } - void addMethodParameter(BaseQuery query, ElasticsearchParametersParameterAccessor parameterAccessor, - ElasticsearchConverter elasticsearchConverter, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + void addSpecialMethodParameters(BaseQuery query, ElasticsearchParametersParameterAccessor parameterAccessor, + ElasticsearchConverter elasticsearchConverter, + QueryMethodEvaluationContextProvider evaluationContextProvider) { if (hasAnnotatedHighlight()) { var highlightQuery = getAnnotatedHighlightQuery(new HighlightConverter(parameterAccessor, diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java index 4bbbefab6..f9c1a830a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java @@ -15,13 +15,8 @@ */ package org.springframework.data.elasticsearch.repository.query; -import org.springframework.core.convert.ConversionService; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.data.elasticsearch.core.query.StringQuery; -import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; -import org.springframework.util.Assert; /** * ElasticsearchStringQuery @@ -32,43 +27,12 @@ * @author Taylor Ono * @author Peter-Josef Meisch * @author Haibo Liu + * @deprecated since 5.5, use {@link RepositoryStringQuery} */ -public class ElasticsearchStringQuery extends AbstractElasticsearchRepositoryQuery { - - private final String queryString; - +@Deprecated(since = "5.5", forRemoval = true) +public class ElasticsearchStringQuery extends RepositoryStringQuery { public ElasticsearchStringQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, String queryString, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, elasticsearchOperations, evaluationContextProvider); - - Assert.notNull(queryString, "Query cannot be empty"); - Assert.notNull(evaluationContextProvider, "ExpressionEvaluationContextProvider must not be null"); - - this.queryString = queryString; - } - - @Override - public boolean isCountQuery() { - return queryMethod.hasCountQueryAnnotation(); - } - - @Override - protected boolean isDeleteQuery() { - return false; - } - - @Override - protected boolean isExistsQuery() { - return false; + super(queryMethod, elasticsearchOperations, queryString, evaluationContextProvider); } - - protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { - ConversionService conversionService = elasticsearchOperations.getElasticsearchConverter().getConversionService(); - var processed = new QueryStringProcessor(queryString, queryMethod, conversionService, evaluationContextProvider) - .createQuery(parameterAccessor); - - return new StringQuery(processed) - .addSort(parameterAccessor.getSort()); - } - } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java index 3fbbfff53..63651bb1c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java @@ -15,68 +15,26 @@ */ package org.springframework.data.elasticsearch.repository.query; -import org.springframework.core.convert.ConversionService; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; -import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.data.elasticsearch.core.query.StringQuery; -import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; -import org.springframework.util.Assert; /** * @author Christoph Strobl * @author Taylor Ono * @author Haibo Liu * @since 3.2 + * @deprecated since 5.5, use {@link ReactiveRepositoryStringQuery} */ -public class ReactiveElasticsearchStringQuery extends AbstractReactiveElasticsearchRepositoryQuery { - - private final String query; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; +@Deprecated(since = "5.5", forRemoval = true) +public class ReactiveElasticsearchStringQuery extends ReactiveRepositoryStringQuery { public ReactiveElasticsearchStringQuery(ReactiveElasticsearchQueryMethod queryMethod, ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - - this(queryMethod.getAnnotatedQuery(), queryMethod, operations, evaluationContextProvider); + super(queryMethod, operations, evaluationContextProvider); } public ReactiveElasticsearchStringQuery(String query, ReactiveElasticsearchQueryMethod queryMethod, ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, operations, evaluationContextProvider); - - Assert.notNull(query, "query must not be null"); - Assert.notNull(evaluationContextProvider, "evaluationContextProvider must not be null"); - - this.query = query; - this.evaluationContextProvider = evaluationContextProvider; - } - - @Override - protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { - ConversionService conversionService = getElasticsearchOperations().getElasticsearchConverter() - .getConversionService(); - String processed = new QueryStringProcessor(query, queryMethod, conversionService, evaluationContextProvider) - .createQuery(parameterAccessor); - return new StringQuery(processed); - } - - @Override - boolean isCountQuery() { - return queryMethod.hasCountQueryAnnotation(); - } - - @Override - boolean isDeleteQuery() { - return false; - } - - @Override - boolean isExistsQuery() { - return false; - } - - @Override - boolean isLimiting() { - return false; + super(query, queryMethod, operations, evaluationContextProvider); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java new file mode 100644 index 000000000..e6ba93826 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java @@ -0,0 +1,92 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.BaseQuery; +import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.util.Assert; + +/** + * A reactive repository query that uses a search template already stored in Elasticsearch. + * + * @author P.J. Meisch (pj.meisch@sothawo.com) + * @since 5.5 + */ +public class ReactiveRepositorySearchTemplateQuery extends AbstractReactiveElasticsearchRepositoryQuery { + + private String id; + private Map params; + + public ReactiveRepositorySearchTemplateQuery(ReactiveElasticsearchQueryMethod queryMethod, + ReactiveElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider, + String id) { + super(queryMethod, elasticsearchOperations, evaluationContextProvider); + Assert.hasLength(id, "id must not be null or empty"); + this.id = id; + } + + public String getId() { + return id; + } + + public Map getParams() { + return params; + } + + @Override + public boolean isCountQuery() { + return false; + } + + @Override + protected boolean isDeleteQuery() { + return false; + } + + @Override + protected boolean isExistsQuery() { + return false; + } + + @Override + boolean isLimiting() { + return false; + } + + @Override + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { + + var searchTemplateParameters = new LinkedHashMap(); + var values = parameterAccessor.getValues(); + + parameterAccessor.getParameters().forEach(parameter -> { + if (!parameter.isSpecialParameter() && parameter.getName().isPresent() && parameter.getIndex() <= values.length) { + searchTemplateParameters.put(parameter.getName().get(), values[parameter.getIndex()]); + } + }); + + return SearchTemplateQuery.builder() + .withId(id) + .withParams(searchTemplateParameters) + .build(); + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java new file mode 100644 index 000000000..f6ea14d35 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java @@ -0,0 +1,83 @@ +/* + * Copyright 2019-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import org.springframework.core.convert.ConversionService; +import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.BaseQuery; +import org.springframework.data.elasticsearch.core.query.StringQuery; +import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.util.Assert; + +/** + * Was originally named ReactiveElasticsearchStringQuery. + * @author Christoph Strobl + * @author Taylor Ono + * @author Haibo Liu + * @since 3.2 + */ +public class ReactiveRepositoryStringQuery extends AbstractReactiveElasticsearchRepositoryQuery { + + private final String query; + private final QueryMethodEvaluationContextProvider evaluationContextProvider; + + public ReactiveRepositoryStringQuery(ReactiveElasticsearchQueryMethod queryMethod, + ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { + + this(queryMethod.getAnnotatedQuery(), queryMethod, operations, evaluationContextProvider); + } + + public ReactiveRepositoryStringQuery(String query, ReactiveElasticsearchQueryMethod queryMethod, + ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { + super(queryMethod, operations, evaluationContextProvider); + + Assert.notNull(query, "query must not be null"); + Assert.notNull(evaluationContextProvider, "evaluationContextProvider must not be null"); + + this.query = query; + this.evaluationContextProvider = evaluationContextProvider; + } + + @Override + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { + ConversionService conversionService = getElasticsearchOperations().getElasticsearchConverter() + .getConversionService(); + String processed = new QueryStringProcessor(query, queryMethod, conversionService, evaluationContextProvider) + .createQuery(parameterAccessor); + return new StringQuery(processed); + } + + @Override + boolean isCountQuery() { + return queryMethod.hasCountQueryAnnotation(); + } + + @Override + boolean isDeleteQuery() { + return false; + } + + @Override + boolean isExistsQuery() { + return false; + } + + @Override + boolean isLimiting() { + return false; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java new file mode 100644 index 000000000..1fe4b60b2 --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java @@ -0,0 +1,75 @@ +/* + * Copyright 2013-2024 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; +import org.springframework.data.elasticsearch.core.query.BaseQuery; +import org.springframework.data.elasticsearch.repository.query.parser.ElasticsearchQueryCreator; +import org.springframework.data.mapping.context.MappingContext; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.parser.PartTree; + +/** + * A repository query that is built from the the method name in the repository definition. + * Was originally named ElasticsearchPartQuery. + * + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Kevin Leturc + * @author Mark Paluch + * @author Rasmus Faber-Espensen + * @author Peter-Josef Meisch + * @author Haibo Liu + */ +public class RepositoryPartQuery extends AbstractElasticsearchRepositoryQuery { + + private final PartTree tree; + private final MappingContext mappingContext; + + public RepositoryPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, + QueryMethodEvaluationContextProvider evaluationContextProvider) { + super(method, elasticsearchOperations, evaluationContextProvider); + this.tree = new PartTree(queryMethod.getName(), queryMethod.getResultProcessor().getReturnedType().getDomainType()); + this.mappingContext = elasticsearchConverter.getMappingContext(); + } + + @Override + public boolean isCountQuery() { + return tree.isCountProjection(); + } + + @Override + protected boolean isDeleteQuery() { + return tree.isDelete(); + } + + @Override + protected boolean isExistsQuery() { + return tree.isExistsProjection(); + } + + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor accessor) { + + BaseQuery query = new ElasticsearchQueryCreator(tree, accessor, mappingContext).createQuery(); + + if (tree.getMaxResults() != null) { + query.setMaxResults(tree.getMaxResults()); + } + + return query; + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java new file mode 100644 index 000000000..e42dacd5e --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java @@ -0,0 +1,86 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.BaseQuery; +import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.util.Assert; + +/** + * A repository query that uses a search template already stored in Elasticsearch. + * + * @author P.J. Meisch (pj.meisch@sothawo.com) + * @since 5.5 + */ +public class RepositorySearchTemplateQuery extends AbstractElasticsearchRepositoryQuery { + + private String id; + private Map params; + + public RepositorySearchTemplateQuery(ElasticsearchQueryMethod queryMethod, + ElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider, + String id) { + super(queryMethod, elasticsearchOperations, evaluationContextProvider); + Assert.hasLength(id, "id must not be null or empty"); + this.id = id; + } + + public String getId() { + return id; + } + + public Map getParams() { + return params; + } + + @Override + public boolean isCountQuery() { + return false; + } + + @Override + protected boolean isDeleteQuery() { + return false; + } + + @Override + protected boolean isExistsQuery() { + return false; + } + + @Override + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { + + var searchTemplateParameters = new LinkedHashMap(); + var values = parameterAccessor.getValues(); + + parameterAccessor.getParameters().forEach(parameter -> { + if (!parameter.isSpecialParameter() && parameter.getName().isPresent() && parameter.getIndex() <= values.length) { + searchTemplateParameters.put(parameter.getName().get(), values[parameter.getIndex()]); + } + }); + + return SearchTemplateQuery.builder() + .withId(id) + .withParams(searchTemplateParameters) + .build(); + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java new file mode 100644 index 000000000..e1f53053a --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java @@ -0,0 +1,58 @@ +package org.springframework.data.elasticsearch.repository.query; + +import org.springframework.core.convert.ConversionService; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.query.BaseQuery; +import org.springframework.data.elasticsearch.core.query.StringQuery; +import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.util.Assert; + +/** + * A repository query that is defined by a String containing the query. + * Was originally named ElasticsearchStringQuery. + * + * @author Rizwan Idrees + * @author Mohsin Husen + * @author Mark Paluch + * @author Taylor Ono + * @author Peter-Josef Meisch + * @author Haibo Liu + */ +public class RepositoryStringQuery extends AbstractElasticsearchRepositoryQuery { + private final String queryString; + + public RepositoryStringQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, + String queryString, QueryMethodEvaluationContextProvider evaluationContextProvider) { + super(queryMethod, elasticsearchOperations, evaluationContextProvider); + + Assert.notNull(queryString, "Query cannot be empty"); + Assert.notNull(evaluationContextProvider, "ExpressionEvaluationContextProvider must not be null"); + + this.queryString = queryString; + } + + @Override + public boolean isCountQuery() { + return queryMethod.hasCountQueryAnnotation(); + } + + @Override + protected boolean isDeleteQuery() { + return false; + } + + @Override + protected boolean isExistsQuery() { + return false; + } + + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { + ConversionService conversionService = elasticsearchOperations.getElasticsearchConverter().getConversionService(); + var processed = new QueryStringProcessor(queryString, queryMethod, conversionService, evaluationContextProvider) + .createQuery(parameterAccessor); + + return new StringQuery(processed) + .addSort(parameterAccessor.getSort()); + } +} diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java index 321cbff34..fb4ccf3ff 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java @@ -22,9 +22,10 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.data.elasticsearch.repository.query.ElasticsearchPartQuery; import org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod; -import org.springframework.data.elasticsearch.repository.query.ElasticsearchStringQuery; +import org.springframework.data.elasticsearch.repository.query.RepositoryPartQuery; +import org.springframework.data.elasticsearch.repository.query.RepositorySearchTemplateQuery; +import org.springframework.data.elasticsearch.repository.query.RepositoryStringQuery; import org.springframework.data.elasticsearch.repository.support.querybyexample.QueryByExampleElasticsearchExecutor; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.querydsl.QuerydslPredicateExecutor; @@ -122,13 +123,17 @@ public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, if (namedQueries.hasQuery(namedQueryName)) { String namedQuery = namedQueries.getQuery(namedQueryName); - return new ElasticsearchStringQuery(queryMethod, elasticsearchOperations, namedQuery, + return new RepositoryStringQuery(queryMethod, elasticsearchOperations, namedQuery, evaluationContextProvider); } else if (queryMethod.hasAnnotatedQuery()) { - return new ElasticsearchStringQuery(queryMethod, elasticsearchOperations, queryMethod.getAnnotatedQuery(), + return new RepositoryStringQuery(queryMethod, elasticsearchOperations, queryMethod.getAnnotatedQuery(), evaluationContextProvider); + } else if (queryMethod.hasAnnotatedSearchTemplateQuery()) { + var searchTemplateQuery = queryMethod.getAnnotatedSearchTemplateQuery(); + return new RepositorySearchTemplateQuery(queryMethod, elasticsearchOperations, evaluationContextProvider, + searchTemplateQuery.id()); } - return new ElasticsearchPartQuery(queryMethod, elasticsearchOperations, evaluationContextProvider); + return new RepositoryPartQuery(queryMethod, elasticsearchOperations, evaluationContextProvider); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java index 49e1e18fc..a4808c78f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java @@ -23,8 +23,10 @@ import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryMethod; -import org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchStringQuery; import org.springframework.data.elasticsearch.repository.query.ReactivePartTreeElasticsearchQuery; +import org.springframework.data.elasticsearch.repository.query.ReactiveRepositorySearchTemplateQuery; +import org.springframework.data.elasticsearch.repository.query.ReactiveRepositoryStringQuery; +import org.springframework.data.elasticsearch.repository.query.RepositorySearchTemplateQuery; import org.springframework.data.elasticsearch.repository.support.querybyexample.ReactiveQueryByExampleElasticsearchExecutor; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.projection.ProjectionFactory; @@ -161,10 +163,14 @@ public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, if (namedQueries.hasQuery(namedQueryName)) { String namedQuery = namedQueries.getQuery(namedQueryName); - return new ReactiveElasticsearchStringQuery(namedQuery, queryMethod, operations, + return new ReactiveRepositoryStringQuery(namedQuery, queryMethod, operations, evaluationContextProvider); } else if (queryMethod.hasAnnotatedQuery()) { - return new ReactiveElasticsearchStringQuery(queryMethod, operations, evaluationContextProvider); + return new ReactiveRepositoryStringQuery(queryMethod, operations, evaluationContextProvider); + } else if (queryMethod.hasAnnotatedSearchTemplateQuery()) { + var searchTemplateQuery = queryMethod.getAnnotatedSearchTemplateQuery(); + return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, evaluationContextProvider, + searchTemplateQuery.id()); } else { return new ReactivePartTreeElasticsearchQuery(queryMethod, operations, evaluationContextProvider); } diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java index 86b395840..40f7dd7ce 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchPartQueryELCIntegrationTests.java @@ -21,7 +21,7 @@ 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.ElasticsearchPartQueryIntegrationTests; +import org.springframework.data.elasticsearch.core.query.RepositoryPartQueryIntegrationTests; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration; @@ -29,7 +29,7 @@ * @author Peter-Josef Meisch * @since 4.4 */ -public class ElasticsearchPartQueryELCIntegrationTests extends ElasticsearchPartQueryIntegrationTests { +public class ElasticsearchPartQueryELCIntegrationTests extends RepositoryPartQueryIntegrationTests { @Configuration @Import({ ElasticsearchTemplateConfiguration.class }) diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java similarity index 98% rename from src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java rename to src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java index d8501cb52..5a55d9c86 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/ElasticsearchPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java @@ -31,15 +31,15 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.data.elasticsearch.repository.query.ElasticsearchPartQuery; import org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod; +import org.springframework.data.elasticsearch.repository.query.RepositoryPartQuery; import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.lang.Nullable; /** - * Tests for {@link ElasticsearchPartQuery}. The tests make sure that queries are built according to the method naming. + * Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming. * Classes implementing this abstract class are in the packages of their request factories and converters as these are * kept package private. * @@ -48,7 +48,7 @@ */ @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") @SpringIntegrationTest -public abstract class ElasticsearchPartQueryIntegrationTests { +public abstract class RepositoryPartQueryIntegrationTests { public static final String BOOK_TITLE = "Title"; public static final int BOOK_PRICE = 42; @@ -646,7 +646,7 @@ private String getQueryString(String methodName, Class[] parameterClasses, Ob ElasticsearchQueryMethod queryMethod = new ElasticsearchQueryMethod(method, new DefaultRepositoryMetadata(SampleRepository.class), new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); - ElasticsearchPartQuery partQuery = new ElasticsearchPartQuery(queryMethod, operations, + RepositoryPartQuery partQuery = new RepositoryPartQuery(queryMethod, operations, QueryMethodEvaluationContextProvider.DEFAULT); Query query = partQuery.createQuery(parameters); return buildQueryString(query, Book.class); diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java deleted file mode 100644 index ef0f79cb7..000000000 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTestBase.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2021-2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.repository.query; - -import java.util.ArrayList; -import java.util.Collection; - -import org.springframework.core.convert.converter.Converter; -import org.springframework.data.convert.CustomConversions; -import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; -import org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions; -import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; -import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; -import org.springframework.lang.Nullable; - -/** - * @author Peter-Josef Meisch - */ -public class ElasticsearchStringQueryUnitTestBase { - - protected ElasticsearchConverter setupConverter() { - MappingElasticsearchConverter converter = new MappingElasticsearchConverter( - new SimpleElasticsearchMappingContext()); - Collection> converters = new ArrayList<>(); - converters.add(ElasticsearchStringQueryUnitTests.CarConverter.INSTANCE); - CustomConversions customConversions = new ElasticsearchCustomConversions(converters); - converter.setConversions(customConversions); - converter.afterPropertiesSet(); - return converter; - } - - static class Car { - @Nullable private String name; - @Nullable private String model; - - @Nullable - public String getName() { - return name; - } - - public void setName(@Nullable String name) { - this.name = name; - } - - @Nullable - public String getModel() { - return model; - } - - public void setModel(@Nullable String model) { - this.model = model; - } - } - - enum CarConverter implements Converter { - INSTANCE; - - @Override - public String convert(ElasticsearchStringQueryUnitTests.Car car) { - return (car.getName() != null ? car.getName() : "null") + '-' - + (car.getModel() != null ? car.getModel() : "null"); - } - } - -} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryQueryUnitTestsBase.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryQueryUnitTestsBase.java new file mode 100644 index 000000000..4ab819632 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryQueryUnitTestsBase.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import static org.mockito.Mockito.*; + +import java.lang.reflect.Method; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; +import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; +import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; +import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; +import org.springframework.data.projection.SpelAwareProxyProjectionFactory; +import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; + +@ExtendWith(MockitoExtension.class) +public class ReactiveRepositoryQueryUnitTestsBase { + + @Mock ReactiveElasticsearchOperations operations; + + /** + * set up the {operations} mock to return the {@link ElasticsearchConverter} from setupConverter(). + */ + @BeforeEach + public void setUp() { + when(operations.getElasticsearchConverter()).thenReturn(setupConverter()); + } + + /** + * @return a simple {@link MappingElasticsearchConverter} with no special setup. + */ + protected MappingElasticsearchConverter setupConverter() { + return new MappingElasticsearchConverter( + new SimpleElasticsearchMappingContext()); + } + + /** + * Creates a {@link ReactiveElasticsearchQueryMethod} for the given method + * + * @param repositoryClass + * @param name + * @param parameters + * @return + * @throws NoSuchMethodException + */ + + protected ReactiveElasticsearchQueryMethod getQueryMethod(Class repositoryClass, String name, + Class... parameters) + throws NoSuchMethodException { + + Method method = repositoryClass.getMethod(name, parameters); + return new ReactiveElasticsearchQueryMethod(method, + new DefaultRepositoryMetadata(repositoryClass), + new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java new file mode 100644 index 000000000..af144dbc3 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import static org.assertj.core.api.Assertions.*; + +import java.util.Arrays; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.data.annotation.Id; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.SearchTemplateQuery; +import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.lang.Nullable; + +public class ReactiveRepositorySearchTemplateQueryUnitTests extends ReactiveRepositoryQueryUnitTestsBase { + + @Test // #2997 + @DisplayName("should set searchtemplate id") + void shouldSetSearchTemplateId() throws NoSuchMethodException { + + var query = createQuery("searchWithArgs", "answer", 42); + + assertThat(query).isInstanceOf(org.springframework.data.elasticsearch.core.query.SearchTemplateQuery.class); + var searchTemplateQuery = (org.springframework.data.elasticsearch.core.query.SearchTemplateQuery) query; + + assertThat(searchTemplateQuery.getId()).isEqualTo("searchtemplate-42"); + } + + @Test // #2997 + @DisplayName("should set searchtemplate parameters") + void shouldSetSearchTemplateParameters() throws NoSuchMethodException { + + var query = createQuery("searchWithArgs", "answer", 42); + + assertThat(query).isInstanceOf(org.springframework.data.elasticsearch.core.query.SearchTemplateQuery.class); + var searchTemplateQuery = (org.springframework.data.elasticsearch.core.query.SearchTemplateQuery) query; + + var params = searchTemplateQuery.getParams(); + assertThat(params).isNotNull().hasSize(2); + assertThat(params.get("stringArg")).isEqualTo("answer"); + assertThat(params.get("intArg")).isEqualTo(42); + } + + // region helper methods + private Query createQuery(String methodName, Object... args) throws NoSuchMethodException { + Class[] argTypes = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new); + ReactiveElasticsearchQueryMethod queryMethod = getQueryMethod(SampleRepository.class, methodName, argTypes); + + ReactiveRepositorySearchTemplateQuery repositorySearchTemplateQuery = queryForMethod(queryMethod); + + return repositorySearchTemplateQuery.createQuery(new ElasticsearchParametersParameterAccessor(queryMethod, args)); + } + + private ReactiveRepositorySearchTemplateQuery queryForMethod(ReactiveElasticsearchQueryMethod queryMethod) { + return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, QueryMethodEvaluationContextProvider.DEFAULT, + queryMethod.getAnnotatedSearchTemplateQuery().id()); + } + // endregion + + // region test data + private interface SampleRepository extends ElasticsearchRepository { + @SearchTemplateQuery(id = "searchtemplate-42") + SearchHits searchWithArgs(String stringArg, Integer intArg); + + @SearchTemplateQuery(id = "searchtemplate-42") + SearchHits searchWithArgsAndSort(String stringArg, Integer intArg, Sort sort); + } + + @Document(indexName = "not-relevant") + static class SampleEntity { + @Nullable + @Id String id; + @Nullable String data; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public String getData() { + return data; + } + + public void setData(@Nullable String data) { + this.data = data; + } + } + // endregion +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java similarity index 89% rename from src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java rename to src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java index e5a9f626d..11d7d6939 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java @@ -16,12 +16,10 @@ package org.springframework.data.elasticsearch.repository.query; import static org.assertj.core.api.Assertions.*; -import static org.mockito.Mockito.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -29,28 +27,27 @@ import java.util.List; import java.util.Map; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; +import org.springframework.core.convert.converter.Converter; import org.springframework.data.annotation.Id; +import org.springframework.data.convert.CustomConversions; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.InnerField; import org.springframework.data.elasticsearch.annotations.MultiField; import org.springframework.data.elasticsearch.annotations.Query; -import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.SearchHit; +import org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions; +import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; -import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.Repository; -import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.lang.Nullable; @@ -60,13 +57,54 @@ * @author Haibo Liu */ @ExtendWith(MockitoExtension.class) -public class ReactiveElasticsearchStringQueryUnitTests extends ElasticsearchStringQueryUnitTestBase { +public class ReactiveRepositoryStringQueryUnitTests extends ReactiveRepositoryQueryUnitTestsBase { - @Mock ReactiveElasticsearchOperations operations; + /** + * Adds some data class and custom conversion to the base class implementation. + */ + protected MappingElasticsearchConverter setupConverter() { + + Collection> converters = new ArrayList<>(); + converters.add(CarConverter.INSTANCE); + CustomConversions customConversions = new ElasticsearchCustomConversions(converters); + + MappingElasticsearchConverter converter = super.setupConverter(); + converter.setConversions(customConversions); + converter.afterPropertiesSet(); + return converter; + } + + static class Car { + @Nullable private String name; + @Nullable private String model; + + @Nullable + public String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } - @BeforeEach - public void setUp() { - when(operations.getElasticsearchConverter()).thenReturn(setupConverter()); + @Nullable + public String getModel() { + return model; + } + + public void setModel(@Nullable String model) { + this.model = model; + } + } + + enum CarConverter implements Converter { + INSTANCE; + + @Override + public String convert(Car car) { + return (car.getName() != null ? car.getName() : "null") + '-' + + (car.getModel() != null ? car.getModel() : "null"); + } } @Test // DATAES-519 @@ -367,29 +405,21 @@ private org.springframework.data.elasticsearch.core.query.Query createQuery(Stri Class[] argTypes = Arrays.stream(args).map(Object::getClass) .map(clazz -> Collection.class.isAssignableFrom(clazz) ? List.class : clazz).toArray(Class[]::new); - ReactiveElasticsearchQueryMethod queryMethod = getQueryMethod(methodName, argTypes); - ReactiveElasticsearchStringQuery elasticsearchStringQuery = queryForMethod(queryMethod); + ReactiveElasticsearchQueryMethod queryMethod = getQueryMethod(SampleRepository.class, methodName, argTypes); + ReactiveRepositoryStringQuery elasticsearchStringQuery = queryForMethod(queryMethod); return elasticsearchStringQuery.createQuery(new ElasticsearchParametersParameterAccessor(queryMethod, args)); } - private ReactiveElasticsearchStringQuery queryForMethod(ReactiveElasticsearchQueryMethod queryMethod) { - return new ReactiveElasticsearchStringQuery(queryMethod, operations, - QueryMethodEvaluationContextProvider.DEFAULT); - } - - private ReactiveElasticsearchQueryMethod getQueryMethod(String name, Class... parameters) - throws NoSuchMethodException { + private ReactiveRepositoryStringQuery createQueryForMethod(String name, Class... parameters) throws Exception { - Method method = SampleRepository.class.getMethod(name, parameters); - return new ReactiveElasticsearchQueryMethod(method, new DefaultRepositoryMetadata(SampleRepository.class), - new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); + ReactiveElasticsearchQueryMethod queryMethod = getQueryMethod(SampleRepository.class, name, parameters); + return queryForMethod(queryMethod); } - private ReactiveElasticsearchStringQuery createQueryForMethod(String name, Class... parameters) throws Exception { - - ReactiveElasticsearchQueryMethod queryMethod = getQueryMethod(name, parameters); - return queryForMethod(queryMethod); + private ReactiveRepositoryStringQuery queryForMethod(ReactiveElasticsearchQueryMethod queryMethod) { + return new ReactiveRepositoryStringQuery(queryMethod, operations, + QueryMethodEvaluationContextProvider.DEFAULT); } private interface SampleRepository extends Repository { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryQueryUnitTestsBase.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryQueryUnitTestsBase.java new file mode 100644 index 000000000..3d80c995a --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryQueryUnitTestsBase.java @@ -0,0 +1,71 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import static org.mockito.Mockito.*; + +import java.lang.reflect.Method; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; +import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; +import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; +import org.springframework.data.projection.SpelAwareProxyProjectionFactory; +import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; + +@ExtendWith(MockitoExtension.class) +public class RepositoryQueryUnitTestsBase { + + @Mock ElasticsearchOperations operations; + + /** + * set up the {operations} mock to return the {@link ElasticsearchConverter} from setupConverter(). + */ + @BeforeEach + public void setUp() { + when(operations.getElasticsearchConverter()).thenReturn(setupConverter()); + } + + /** + * @return a simple {@link MappingElasticsearchConverter} with no special setup. + */ + protected MappingElasticsearchConverter setupConverter() { + return new MappingElasticsearchConverter( + new SimpleElasticsearchMappingContext()); + } + + /** + * Creates a {@link ElasticsearchQueryMethod} for the given method + * + * @param repositoryClass + * @param name + * @param parameters + * @return + * @throws NoSuchMethodException + */ + protected ElasticsearchQueryMethod getQueryMethod(Class repositoryClass, String name, Class... parameters) + throws NoSuchMethodException { + + Method method = repositoryClass.getMethod(name, parameters); + return new ElasticsearchQueryMethod(method, new DefaultRepositoryMetadata(repositoryClass), + new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); + } + +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java new file mode 100644 index 000000000..1b0f62109 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +import static org.assertj.core.api.Assertions.*; + +import java.util.Arrays; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.data.annotation.Id; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.SearchTemplateQuery; +import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.query.Query; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; +import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.lang.Nullable; + +public class RepositorySearchTemplateQueryUnitTests extends RepositoryQueryUnitTestsBase { + + @Test // #2997 + @DisplayName("should set searchtemplate id") + void shouldSetSearchTemplateId() throws NoSuchMethodException { + + var query = createQuery("searchWithArgs", "answer", 42); + + assertThat(query).isInstanceOf(org.springframework.data.elasticsearch.core.query.SearchTemplateQuery.class); + var searchTemplateQuery = (org.springframework.data.elasticsearch.core.query.SearchTemplateQuery) query; + + assertThat(searchTemplateQuery.getId()).isEqualTo("searchtemplate-42"); + } + + @Test // #2997 + @DisplayName("should set searchtemplate parameters") + void shouldSetSearchTemplateParameters() throws NoSuchMethodException { + + var query = createQuery("searchWithArgs", "answer", 42); + + assertThat(query).isInstanceOf(org.springframework.data.elasticsearch.core.query.SearchTemplateQuery.class); + var searchTemplateQuery = (org.springframework.data.elasticsearch.core.query.SearchTemplateQuery) query; + + var params = searchTemplateQuery.getParams(); + assertThat(params).isNotNull().hasSize(2); + assertThat(params.get("stringArg")).isEqualTo("answer"); + assertThat(params.get("intArg")).isEqualTo(42); + } + + // region helper methods + private Query createQuery(String methodName, Object... args) throws NoSuchMethodException { + Class[] argTypes = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new); + ElasticsearchQueryMethod queryMethod = getQueryMethod(SampleRepository.class, methodName, argTypes); + + RepositorySearchTemplateQuery repositorySearchTemplateQuery = queryForMethod(queryMethod); + + return repositorySearchTemplateQuery.createQuery(new ElasticsearchParametersParameterAccessor(queryMethod, args)); + } + + private RepositorySearchTemplateQuery queryForMethod(ElasticsearchQueryMethod queryMethod) { + return new RepositorySearchTemplateQuery(queryMethod, operations, QueryMethodEvaluationContextProvider.DEFAULT, + queryMethod.getAnnotatedSearchTemplateQuery().id()); + } + // endregion + + // region test data + private interface SampleRepository extends ElasticsearchRepository { + @SearchTemplateQuery(id = "searchtemplate-42") + SearchHits searchWithArgs(String stringArg, Integer intArg); + + @SearchTemplateQuery(id = "searchtemplate-42") + SearchHits searchWithArgsAndSort(String stringArg, Integer intArg, Sort sort); + } + + @Document(indexName = "not-relevant") + static class SampleEntity { + @Nullable + @Id String id; + @Nullable String data; + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public String getData() { + return data; + } + + public void setData(@Nullable String data) { + this.data = data; + } + } + // endregion +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java similarity index 89% rename from src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java rename to src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java index c15612ff6..eebc20a04 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java @@ -16,9 +16,7 @@ package org.springframework.data.elasticsearch.repository.query; import static org.assertj.core.api.Assertions.*; -import static org.mockito.Mockito.*; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -26,28 +24,25 @@ import java.util.List; import java.util.Map; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; +import org.springframework.core.convert.converter.Converter; import org.springframework.data.annotation.Id; +import org.springframework.data.convert.CustomConversions; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.InnerField; import org.springframework.data.elasticsearch.annotations.MultiField; import org.springframework.data.elasticsearch.annotations.Query; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.convert.ElasticsearchCustomConversions; +import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; -import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.Repository; -import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.lang.Nullable; @@ -57,14 +52,53 @@ * @author Niklas Herder * @author Haibo Liu */ -@ExtendWith(MockitoExtension.class) -public class ElasticsearchStringQueryUnitTests extends ElasticsearchStringQueryUnitTestBase { +public class RepositoryStringQueryUnitTests extends RepositoryStringQueryUnitTestsBase { + /** + * Adds some data class and custom conversion to the base class implementation. + */ + protected MappingElasticsearchConverter setupConverter() { + + Collection> converters = new ArrayList<>(); + converters.add(RepositoryStringQueryUnitTests.CarConverter.INSTANCE); + CustomConversions customConversions = new ElasticsearchCustomConversions(converters); + + MappingElasticsearchConverter converter = super.setupConverter(); + converter.setConversions(customConversions); + converter.afterPropertiesSet(); + return converter; + } + + static class Car { + @Nullable private String name; + @Nullable private String model; + + @Nullable + public String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } - @Mock ElasticsearchOperations operations; + @Nullable + public String getModel() { + return model; + } - @BeforeEach - public void setUp() { - when(operations.getElasticsearchConverter()).thenReturn(setupConverter()); + public void setModel(@Nullable String model) { + this.model = model; + } + } + + enum CarConverter implements Converter { + INSTANCE; + + @Override + public String convert(Car car) { + return (car.getName() != null ? car.getName() : "null") + '-' + + (car.getModel() != null ? car.getModel() : "null"); + } } @Test // DATAES-552 @@ -350,8 +384,9 @@ private org.springframework.data.elasticsearch.core.query.Query createQuery(Stri throws NoSuchMethodException { Class[] argTypes = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new); - ElasticsearchQueryMethod queryMethod = getQueryMethod(methodName, argTypes); - ElasticsearchStringQuery elasticsearchStringQuery = queryForMethod(queryMethod); + ElasticsearchQueryMethod queryMethod = getQueryMethod(RepositoryStringQueryUnitTests.SampleRepository.class, + methodName, argTypes); + RepositoryStringQuery elasticsearchStringQuery = queryForMethod(queryMethod); return elasticsearchStringQuery.createQuery(new ElasticsearchParametersParameterAccessor(queryMethod, args)); } @@ -370,18 +405,11 @@ void shouldUseConverterOnParameters() throws NoSuchMethodException { .isEqualTo("{ 'bool' : { 'must' : { 'term' : { 'car' : 'Toyota-Prius' } } } }"); } - private ElasticsearchStringQuery queryForMethod(ElasticsearchQueryMethod queryMethod) { - return new ElasticsearchStringQuery(queryMethod, operations, queryMethod.getAnnotatedQuery(), + private RepositoryStringQuery queryForMethod(ElasticsearchQueryMethod queryMethod) { + return new RepositoryStringQuery(queryMethod, operations, queryMethod.getAnnotatedQuery(), QueryMethodEvaluationContextProvider.DEFAULT); } - private ElasticsearchQueryMethod getQueryMethod(String name, Class... parameters) throws NoSuchMethodException { - - Method method = SampleRepository.class.getMethod(name, parameters); - return new ElasticsearchQueryMethod(method, new DefaultRepositoryMetadata(SampleRepository.class), - new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); - } - private interface SampleRepository extends Repository { @Query("{ 'bool' : { 'must' : { 'term' : { 'age' : ?0 } } } }") diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTestsBase.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTestsBase.java new file mode 100644 index 000000000..c6ae39743 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTestsBase.java @@ -0,0 +1,23 @@ +/* + * Copyright 2021-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.query; + +/** + * @author Peter-Josef Meisch + */ +public class RepositoryStringQueryUnitTestsBase extends RepositoryQueryUnitTestsBase { + +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryELCIntegrationTests.java new file mode 100644 index 000000000..da0183438 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryELCIntegrationTests.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.support; + +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.ReactiveElasticsearchTemplateConfiguration; +import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.test.context.ContextConfiguration; + +/** + * @since 5.5 + */ +@ContextConfiguration(classes = ReactiveRepositoryQueryELCIntegrationTests.Config.class) +public class ReactiveRepositoryQueryELCIntegrationTests + extends ReactiveRepositoryQueryIntegrationTests { + + @Configuration + @Import({ ReactiveElasticsearchTemplateConfiguration.class }) + @EnableReactiveElasticsearchRepositories(considerNestedRepositories = true) + static class Config { + @Bean + IndexNameProvider indexNameProvider() { + return new IndexNameProvider("reactive-repository-query"); + } + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java new file mode 100644 index 000000000..674db9bfa --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java @@ -0,0 +1,159 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.support; + +import static org.assertj.core.api.Assertions.*; +import static org.springframework.data.elasticsearch.core.IndexOperationsAdapter.*; + +import reactor.core.publisher.Flux; + +import java.util.List; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.SearchTemplateQuery; +import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; +import org.springframework.data.elasticsearch.core.SearchHit; +import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; +import org.springframework.data.elasticsearch.core.script.Script; +import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; +import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.lang.Nullable; + +/** + * @since 5.5 + */ +@SpringIntegrationTest +abstract class ReactiveRepositoryQueryIntegrationTests { + @Autowired private SampleElasticsearchRepository repository; + @Autowired private ReactiveElasticsearchOperations operations; + @Autowired private IndexNameProvider indexNameProvider; + + @BeforeEach + void before() { + indexNameProvider.increment(); + blocking(operations.indexOps(LOTRCharacter.class)).createWithMapping(); + } + + @Test + @org.junit.jupiter.api.Order(Integer.MAX_VALUE) + public void cleanup() { + blocking(operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*"))).delete(); + } + + @Test // #2997 + @DisplayName("should use searchtemplate query") + void shouldUseSearchtemplateQuery() { + // store some data + repository.saveAll(List.of( + new LOTRCharacter("1", "Frodo is a hobbit"), + new LOTRCharacter("2", "Legolas is an elf"), + new LOTRCharacter("3", "Gandalf is a wizard"), + new LOTRCharacter("4", "Bilbo is a hobbit"), + new LOTRCharacter("5", "Gimli is a dwarf"))) + .blockLast(); + + // store a searchtemplate + String searchInCharacter = """ + { + "query": { + "bool": { + "must": [ + { + "match": { + "lotrCharacter": "{{word}}" + } + } + ] + } + }, + "from": 0, + "size": 100, + "sort": { + "id": { + "order": "desc" + } + } + } + """; + + Script scriptSearchInCharacter = Script.builder() // + .withId("searchInCharacter") // + .withLanguage("mustache") // + .withSource(searchInCharacter) // + .build(); + + var success = operations.putScript(scriptSearchInCharacter).block(); + assertThat(success).isTrue(); + + // search with repository for hobbits order by id descending + var searchHits = repository.searchInCharacter("hobbit") + .collectList().block(); + + // check result (bilbo, frodo) + assertThat(searchHits).isNotNull(); + assertThat(searchHits.size()).isEqualTo(2); + assertThat(searchHits.get(0).getId()).isEqualTo("4"); + assertThat(searchHits.get(1).getId()).isEqualTo("1"); + } + + @Document(indexName = "#{@indexNameProvider.indexName()}") + static class LOTRCharacter { + @Nullable + @Id + @Field(fielddata = true) // needed for the sort to work + private String id; + + @Field(type = FieldType.Text) + @Nullable private String lotrCharacter; + + public LOTRCharacter(@Nullable String id, @Nullable String lotrCharacter) { + this.id = id; + this.lotrCharacter = lotrCharacter; + } + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public String getLotrCharacter() { + return lotrCharacter; + } + + public void setLotrCharacter(@Nullable String lotrCharacter) { + this.lotrCharacter = lotrCharacter; + } + } + + interface SampleElasticsearchRepository + extends ReactiveElasticsearchRepository { + @SearchTemplateQuery(id = "searchInCharacter") + Flux> searchInCharacter(String word); + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryELCIntegrationTests.java new file mode 100644 index 000000000..bc079feb7 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryELCIntegrationTests.java @@ -0,0 +1,38 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.support; + +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.data.elasticsearch.repository.config.EnableElasticsearchRepositories; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(classes = {RepositoryQueryELCIntegrationTests.Config.class })public class RepositoryQueryELCIntegrationTests extends RepositoryQueryIntegrationTests { + @Configuration + @Import({ElasticsearchTemplateConfiguration.class }) + @EnableElasticsearchRepositories(basePackages = {"org.springframework.data.elasticsearch.repository.support" }, + considerNestedRepositories = true) + static class Config { + @Bean + IndexNameProvider indexNameProvider() { + return new IndexNameProvider("repository-query"); + } + + } +} diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java new file mode 100644 index 000000000..4787d7773 --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java @@ -0,0 +1,151 @@ +/* + * Copyright 2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.elasticsearch.repository.support; + +import static org.assertj.core.api.Assertions.*; + +import java.util.List; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.SearchTemplateQuery; +import org.springframework.data.elasticsearch.core.ElasticsearchOperations; +import org.springframework.data.elasticsearch.core.SearchHits; +import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; +import org.springframework.data.elasticsearch.core.script.Script; +import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; +import org.springframework.data.elasticsearch.utils.IndexNameProvider; +import org.springframework.lang.Nullable; + +@SpringIntegrationTest +abstract class RepositoryQueryIntegrationTests { + @Autowired private SampleElasticsearchRepository repository; + @Autowired private ElasticsearchOperations operations; + @Autowired private IndexNameProvider indexNameProvider; + + @BeforeEach + void before() { + indexNameProvider.increment(); + operations.indexOps(LOTRCharacter.class).createWithMapping(); + } + + @Test + @org.junit.jupiter.api.Order(Integer.MAX_VALUE) + public void cleanup() { + operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete(); + } + + @Test // #2997 + @DisplayName("should use searchtemplate query") + void shouldUseSearchtemplateQuery() { + // store some data + repository.saveAll(List.of( + new LOTRCharacter("1", "Frodo is a hobbit"), + new LOTRCharacter("2", "Legolas is an elf"), + new LOTRCharacter("3", "Gandalf is a wizard"), + new LOTRCharacter("4", "Bilbo is a hobbit"), + new LOTRCharacter("5", "Gimli is a dwarf"))); + + // store a searchtemplate + String searchInCharacter = """ + { + "query": { + "bool": { + "must": [ + { + "match": { + "lotrCharacter": "{{word}}" + } + } + ] + } + }, + "from": 0, + "size": 100, + "sort": { + "id": { + "order": "desc" + } + } + } + """; + + Script scriptSearchInCharacter = Script.builder() // + .withId("searchInCharacter") // + .withLanguage("mustache") // + .withSource(searchInCharacter) // + .build(); + + var success = operations.putScript(scriptSearchInCharacter); + assertThat(success).isTrue(); + + // search with repository for hobbits order by id descending + var searchHits = repository.searchInCharacter("hobbit"); + + // check result (bilbo, frodo) + assertThat(searchHits).isNotNull(); + assertThat(searchHits.getTotalHits()).isEqualTo(2); + assertThat(searchHits.getSearchHit(0).getId()).isEqualTo("4"); + assertThat(searchHits.getSearchHit(1).getId()).isEqualTo("1"); + } + + @Document(indexName = "#{@indexNameProvider.indexName()}") + static class LOTRCharacter { + @Nullable + @Id + @Field(fielddata = true) // needed for the sort to work + private String id; + + @Field(type = FieldType.Text) + @Nullable private String lotrCharacter; + + public LOTRCharacter(@Nullable String id, @Nullable String lotrCharacter) { + this.id = id; + this.lotrCharacter = lotrCharacter; + } + + @Nullable + public String getId() { + return id; + } + + public void setId(@Nullable String id) { + this.id = id; + } + + @Nullable + public String getLotrCharacter() { + return lotrCharacter; + } + + public void setLotrCharacter(@Nullable String lotrCharacter) { + this.lotrCharacter = lotrCharacter; + } + } + + interface SampleElasticsearchRepository + extends ElasticsearchRepository { + @SearchTemplateQuery(id = "searchInCharacter") + SearchHits searchInCharacter(String word); + } +} From ea62cf0abdc578c7e648ac57bdd3f104a544401b Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 9 Feb 2025 20:20:01 +0100 Subject: [PATCH 068/131] Adopt to deprecation removals in Commons. Original Pull Request #3051 Closes #3050 Signed-off-by: Peter-Josef Meisch --- .../AbstractElasticsearchRepositoryQuery.java | 6 +- ...tReactiveElasticsearchRepositoryQuery.java | 5 +- .../query/ElasticsearchPartQuery.java | 12 ++-- .../query/ElasticsearchQueryMethod.java | 14 ++--- .../query/ElasticsearchStringQuery.java | 6 +- .../repository/query/HighlightConverter.java | 10 ++-- .../ReactiveElasticsearchQueryMethod.java | 7 +-- .../ReactiveElasticsearchStringQuery.java | 10 ++-- .../ReactivePartTreeElasticsearchQuery.java | 7 ++- ...ReactiveRepositorySearchTemplateQuery.java | 17 +++--- .../query/ReactiveRepositoryStringQuery.java | 13 ++-- .../repository/query/RepositoryPartQuery.java | 11 ++-- .../query/RepositorySearchTemplateQuery.java | 13 ++-- .../query/RepositoryStringQuery.java | 59 +++++++++---------- .../ElasticsearchRepositoryFactory.java | 20 +++---- .../support/QueryStringProcessor.java | 5 +- ...eactiveElasticsearchRepositoryFactory.java | 27 ++++----- .../spel/QueryStringSpELEvaluator.java | 10 ++-- .../RepositoryPartQueryIntegrationTests.java | 3 +- ...epositorySearchTemplateQueryUnitTests.java | 4 +- ...eactiveRepositoryStringQueryUnitTests.java | 3 +- ...epositorySearchTemplateQueryUnitTests.java | 4 +- .../query/RepositoryStringQueryUnitTests.java | 4 +- 23 files changed, 130 insertions(+), 140 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java index be7ca9f17..aa4f84e08 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java @@ -25,9 +25,9 @@ import org.springframework.data.elasticsearch.core.query.DeleteQuery; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.repository.query.ParametersParameterAccessor; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ResultProcessor; import org.springframework.data.util.StreamUtils; @@ -50,11 +50,11 @@ public abstract class AbstractElasticsearchRepositoryQuery implements Repository protected ElasticsearchQueryMethod queryMethod; protected final ElasticsearchOperations elasticsearchOperations; protected final ElasticsearchConverter elasticsearchConverter; - protected final QueryMethodEvaluationContextProvider evaluationContextProvider; + protected final ValueEvaluationContextProvider evaluationContextProvider; public AbstractElasticsearchRepositoryQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { Assert.notNull(queryMethod, "queryMethod must not be null"); Assert.notNull(elasticsearchOperations, "elasticsearchOperations must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java index 384743562..6bd79fb90 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.repository.query; +import org.springframework.data.expression.ValueEvaluationContextProvider; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,11 +53,11 @@ abstract class AbstractReactiveElasticsearchRepositoryQuery implements Repositor protected final ReactiveElasticsearchQueryMethod queryMethod; private final ReactiveElasticsearchOperations elasticsearchOperations; - protected final QueryMethodEvaluationContextProvider evaluationContextProvider; + protected final ValueEvaluationContextProvider evaluationContextProvider; AbstractReactiveElasticsearchRepositoryQuery(ReactiveElasticsearchQueryMethod queryMethod, ReactiveElasticsearchOperations elasticsearchOperations, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { Assert.notNull(queryMethod, "queryMethod must not be null"); Assert.notNull(elasticsearchOperations, "elasticsearchOperations must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java index c3efcd47d..f06eba308 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchPartQuery.java @@ -16,12 +16,7 @@ package org.springframework.data.elasticsearch.repository.query; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; -import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.data.elasticsearch.repository.query.parser.ElasticsearchQueryCreator; -import org.springframework.data.mapping.context.MappingContext; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; -import org.springframework.data.repository.query.parser.PartTree; +import org.springframework.data.repository.query.ValueExpressionDelegate; /** * ElasticsearchPartQuery @@ -37,7 +32,8 @@ */ @Deprecated(forRemoval = true) public class ElasticsearchPartQuery extends RepositoryPartQuery { - public ElasticsearchPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(method, elasticsearchOperations, evaluationContextProvider); + public ElasticsearchPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, + ValueExpressionDelegate valueExpressionDelegate) { + super(method, elasticsearchOperations, valueExpressionDelegate); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index 6a3608bec..5433a3bd6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -44,6 +44,7 @@ import org.springframework.data.elasticsearch.core.query.ScriptedField; import org.springframework.data.elasticsearch.core.query.SourceFilter; import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.repository.core.RepositoryMetadata; @@ -105,13 +106,6 @@ public ElasticsearchQueryMethod(Method method, RepositoryMetadata repositoryMeta verifyCountQueryTypes(); } - @SuppressWarnings("removal") - @Override - @Deprecated - protected Parameters createParameters(Method method, TypeInformation domainType) { - return new ElasticsearchParameters(ParametersSource.of(method)); - } - @Override protected Parameters createParameters(ParametersSource parametersSource) { return new ElasticsearchParameters(parametersSource); @@ -331,7 +325,7 @@ public boolean hasCountQueryAnnotation() { @Nullable SourceFilter getSourceFilter(ElasticsearchParametersParameterAccessor parameterAccessor, ElasticsearchConverter converter, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { if (sourceFilters == null || (sourceFilters.includes().length == 0 && sourceFilters.excludes().length == 0)) { return null; @@ -354,7 +348,7 @@ SourceFilter getSourceFilter(ElasticsearchParametersParameterAccessor parameterA } private String[] mapParameters(String[] source, ElasticsearchParametersParameterAccessor parameterAccessor, - ConversionService conversionService, QueryMethodEvaluationContextProvider evaluationContextProvider) { + ConversionService conversionService, ValueEvaluationContextProvider evaluationContextProvider) { List fieldNames = new ArrayList<>(); @@ -407,7 +401,7 @@ private Class potentiallyUnwrapReturnTypeFor(RepositoryMetadata metadata, Met void addSpecialMethodParameters(BaseQuery query, ElasticsearchParametersParameterAccessor parameterAccessor, ElasticsearchConverter elasticsearchConverter, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { if (hasAnnotatedHighlight()) { var highlightQuery = getAnnotatedHighlightQuery(new HighlightConverter(parameterAccessor, diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java index f9c1a830a..32f7d32a7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchStringQuery.java @@ -16,7 +16,7 @@ package org.springframework.data.elasticsearch.repository.query; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; /** * ElasticsearchStringQuery @@ -32,7 +32,7 @@ @Deprecated(since = "5.5", forRemoval = true) public class ElasticsearchStringQuery extends RepositoryStringQuery { public ElasticsearchStringQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, - String queryString, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, elasticsearchOperations, queryString, evaluationContextProvider); + String queryString, ValueExpressionDelegate valueExpressionDelegate) { + super(queryMethod, elasticsearchOperations, queryString, valueExpressionDelegate); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java index 843aadecd..21b134b2b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/HighlightConverter.java @@ -25,8 +25,8 @@ import org.springframework.data.elasticsearch.core.query.highlight.HighlightField; import org.springframework.data.elasticsearch.core.query.highlight.HighlightParameters; import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.util.Assert; /** @@ -38,13 +38,13 @@ public class HighlightConverter { private final ElasticsearchParametersParameterAccessor parameterAccessor; private final ConversionService conversionService; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; + private final ValueEvaluationContextProvider evaluationContextProvider; private final QueryMethod queryMethod; HighlightConverter(ElasticsearchParametersParameterAccessor parameterAccessor, - ConversionService conversionService, - QueryMethodEvaluationContextProvider evaluationContextProvider, - QueryMethod queryMethod) { + ConversionService conversionService, + ValueEvaluationContextProvider evaluationContextProvider, + QueryMethod queryMethod) { Assert.notNull(parameterAccessor, "parameterAccessor must not be null"); Assert.notNull(conversionService, "conversionService must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java index 320ff5cf6..422eb46db 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethod.java @@ -15,8 +15,6 @@ */ package org.springframework.data.elasticsearch.repository.query; -import static org.springframework.data.repository.util.ClassUtils.*; - import reactor.core.publisher.Mono; import java.lang.reflect.Method; @@ -36,6 +34,7 @@ import org.springframework.data.repository.util.ReactiveWrapperConverters; import org.springframework.data.util.Lazy; import org.springframework.data.util.ReactiveWrappers; +import org.springframework.data.util.ReflectionUtils; import org.springframework.data.util.TypeInformation; import org.springframework.util.ClassUtils; @@ -55,7 +54,7 @@ public ReactiveElasticsearchQueryMethod(Method method, RepositoryMetadata metada super(method, metadata, factory, mappingContext); - if (hasParameterOfType(method, Pageable.class)) { + if (ReflectionUtils.hasParameterOfType(method, Pageable.class)) { TypeInformation returnType = TypeInformation.fromReturnTypeOf(method); boolean multiWrapper = ReactiveWrappers.isMultiValueType(returnType.getType()); @@ -75,7 +74,7 @@ public ReactiveElasticsearchQueryMethod(Method method, RepositoryMetadata metada method)); } - if (hasParameterOfType(method, Sort.class)) { + if (ReflectionUtils.hasParameterOfType(method, Sort.class)) { throw new IllegalStateException(String.format("Method must not have Pageable *and* Sort parameter. " + "Use sorting capabilities on Pageable instead! Offending method: %s", method)); } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java index 63651bb1c..f636a566d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchStringQuery.java @@ -16,7 +16,7 @@ package org.springframework.data.elasticsearch.repository.query; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; /** * @author Christoph Strobl @@ -29,12 +29,12 @@ public class ReactiveElasticsearchStringQuery extends ReactiveRepositoryStringQuery { public ReactiveElasticsearchStringQuery(ReactiveElasticsearchQueryMethod queryMethod, - ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, operations, evaluationContextProvider); + ReactiveElasticsearchOperations operations, ValueExpressionDelegate valueExpressionDelegate) { + super(queryMethod, operations, valueExpressionDelegate); } public ReactiveElasticsearchStringQuery(String query, ReactiveElasticsearchQueryMethod queryMethod, - ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(query, queryMethod, operations, evaluationContextProvider); + ReactiveElasticsearchOperations operations, ValueExpressionDelegate valueExpressionDelegate) { + super(query, queryMethod, operations, valueExpressionDelegate); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java index 1b16e2e5a..417106457 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactivePartTreeElasticsearchQuery.java @@ -19,8 +19,8 @@ import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import org.springframework.data.elasticsearch.repository.query.parser.ElasticsearchQueryCreator; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.ResultProcessor; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.data.repository.query.parser.PartTree; /** @@ -35,8 +35,9 @@ public class ReactivePartTreeElasticsearchQuery extends AbstractReactiveElastics public ReactivePartTreeElasticsearchQuery(ReactiveElasticsearchQueryMethod queryMethod, ReactiveElasticsearchOperations elasticsearchOperations, - QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, elasticsearchOperations, evaluationContextProvider); + ValueExpressionDelegate valueExpressionDelegate) { + super(queryMethod, elasticsearchOperations, + valueExpressionDelegate.createValueContextProvider(queryMethod.getParameters())); ResultProcessor processor = queryMethod.getResultProcessor(); this.tree = new PartTree(queryMethod.getName(), processor.getReturnedType().getDomainType()); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java index e6ba93826..12e09eebf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQuery.java @@ -18,11 +18,10 @@ import java.util.LinkedHashMap; import java.util.Map; -import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.util.Assert; /** @@ -37,9 +36,11 @@ public class ReactiveRepositorySearchTemplateQuery extends AbstractReactiveElast private Map params; public ReactiveRepositorySearchTemplateQuery(ReactiveElasticsearchQueryMethod queryMethod, - ReactiveElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider, - String id) { - super(queryMethod, elasticsearchOperations, evaluationContextProvider); + ReactiveElasticsearchOperations elasticsearchOperations, + ValueExpressionDelegate valueExpressionDelegate, + String id) { + super(queryMethod, elasticsearchOperations, + valueExpressionDelegate.createValueContextProvider(queryMethod.getParameters())); Assert.hasLength(id, "id must not be null or empty"); this.id = id; } @@ -84,9 +85,9 @@ protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor paramet } }); - return SearchTemplateQuery.builder() - .withId(id) - .withParams(searchTemplateParameters) + return SearchTemplateQuery.builder() + .withId(id) + .withParams(searchTemplateParameters) .build(); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java index f6ea14d35..11e3b81ec 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java @@ -21,10 +21,12 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.util.Assert; /** * Was originally named ReactiveElasticsearchStringQuery. + * * @author Christoph Strobl * @author Taylor Ono * @author Haibo Liu @@ -33,23 +35,20 @@ public class ReactiveRepositoryStringQuery extends AbstractReactiveElasticsearchRepositoryQuery { private final String query; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; public ReactiveRepositoryStringQuery(ReactiveElasticsearchQueryMethod queryMethod, - ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { + ReactiveElasticsearchOperations operations, ValueExpressionDelegate valueExpressionDelegate) { - this(queryMethod.getAnnotatedQuery(), queryMethod, operations, evaluationContextProvider); + this(queryMethod.getAnnotatedQuery(), queryMethod, operations, valueExpressionDelegate); } public ReactiveRepositoryStringQuery(String query, ReactiveElasticsearchQueryMethod queryMethod, - ReactiveElasticsearchOperations operations, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, operations, evaluationContextProvider); + ReactiveElasticsearchOperations operations, ValueExpressionDelegate valueExpressionDelegate) { + super(queryMethod, operations, valueExpressionDelegate.createValueContextProvider(queryMethod.getParameters())); Assert.notNull(query, "query must not be null"); - Assert.notNull(evaluationContextProvider, "evaluationContextProvider must not be null"); this.query = query; - this.evaluationContextProvider = evaluationContextProvider; } @Override diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java index 1fe4b60b2..578a30e9c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryPartQuery.java @@ -20,12 +20,12 @@ import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.repository.query.parser.ElasticsearchQueryCreator; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.data.repository.query.parser.PartTree; /** - * A repository query that is built from the the method name in the repository definition. - * Was originally named ElasticsearchPartQuery. + * A repository query that is built from the the method name in the repository definition. Was originally named + * ElasticsearchPartQuery. * * @author Rizwan Idrees * @author Mohsin Husen @@ -41,8 +41,9 @@ public class RepositoryPartQuery extends AbstractElasticsearchRepositoryQuery { private final MappingContext mappingContext; public RepositoryPartQuery(ElasticsearchQueryMethod method, ElasticsearchOperations elasticsearchOperations, - QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(method, elasticsearchOperations, evaluationContextProvider); + ValueExpressionDelegate valueExpressionDelegate) { + super(method, elasticsearchOperations, + valueExpressionDelegate.createValueContextProvider(method.getParameters())); this.tree = new PartTree(queryMethod.getName(), queryMethod.getResultProcessor().getReturnedType().getDomainType()); this.mappingContext = elasticsearchConverter.getMappingContext(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java index e42dacd5e..ddec6e2f0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQuery.java @@ -21,7 +21,7 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.SearchTemplateQuery; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.util.Assert; /** @@ -36,9 +36,10 @@ public class RepositorySearchTemplateQuery extends AbstractElasticsearchReposito private Map params; public RepositorySearchTemplateQuery(ElasticsearchQueryMethod queryMethod, - ElasticsearchOperations elasticsearchOperations, QueryMethodEvaluationContextProvider evaluationContextProvider, + ElasticsearchOperations elasticsearchOperations, ValueExpressionDelegate valueExpressionDelegate, String id) { - super(queryMethod, elasticsearchOperations, evaluationContextProvider); + super(queryMethod, elasticsearchOperations, + valueExpressionDelegate.createValueContextProvider(queryMethod.getParameters())); Assert.hasLength(id, "id must not be null or empty"); this.id = id; } @@ -78,9 +79,9 @@ protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor paramet } }); - return SearchTemplateQuery.builder() - .withId(id) - .withParams(searchTemplateParameters) + return SearchTemplateQuery.builder() + .withId(id) + .withParams(searchTemplateParameters) .build(); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java index e1f53053a..1b768b6ea 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQuery.java @@ -5,12 +5,11 @@ import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.util.Assert; /** - * A repository query that is defined by a String containing the query. - * Was originally named ElasticsearchStringQuery. + * A repository query that is defined by a String containing the query. Was originally named ElasticsearchStringQuery. * * @author Rizwan Idrees * @author Mohsin Husen @@ -20,39 +19,39 @@ * @author Haibo Liu */ public class RepositoryStringQuery extends AbstractElasticsearchRepositoryQuery { - private final String queryString; + private final String queryString; - public RepositoryStringQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, - String queryString, QueryMethodEvaluationContextProvider evaluationContextProvider) { - super(queryMethod, elasticsearchOperations, evaluationContextProvider); + public RepositoryStringQuery(ElasticsearchQueryMethod queryMethod, ElasticsearchOperations elasticsearchOperations, + String queryString, ValueExpressionDelegate valueExpressionDelegate) { + super(queryMethod, elasticsearchOperations, + valueExpressionDelegate.createValueContextProvider(queryMethod.getParameters())); - Assert.notNull(queryString, "Query cannot be empty"); - Assert.notNull(evaluationContextProvider, "ExpressionEvaluationContextProvider must not be null"); + Assert.notNull(queryString, "Query cannot be empty"); - this.queryString = queryString; - } + this.queryString = queryString; + } - @Override - public boolean isCountQuery() { - return queryMethod.hasCountQueryAnnotation(); - } + @Override + public boolean isCountQuery() { + return queryMethod.hasCountQueryAnnotation(); + } - @Override - protected boolean isDeleteQuery() { - return false; - } + @Override + protected boolean isDeleteQuery() { + return false; + } - @Override - protected boolean isExistsQuery() { - return false; - } + @Override + protected boolean isExistsQuery() { + return false; + } - protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { - ConversionService conversionService = elasticsearchOperations.getElasticsearchConverter().getConversionService(); - var processed = new QueryStringProcessor(queryString, queryMethod, conversionService, evaluationContextProvider) - .createQuery(parameterAccessor); + protected BaseQuery createQuery(ElasticsearchParametersParameterAccessor parameterAccessor) { + ConversionService conversionService = elasticsearchOperations.getElasticsearchConverter().getConversionService(); + var processed = new QueryStringProcessor(queryString, queryMethod, conversionService, evaluationContextProvider) + .createQuery(parameterAccessor); - return new StringQuery(processed) - .addSort(parameterAccessor.getSort()); - } + return new StringQuery(processed) + .addSort(parameterAccessor.getSort()); + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java index fb4ccf3ff..0d899bbed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java @@ -38,8 +38,8 @@ import org.springframework.data.repository.query.QueryByExampleExecutor; import org.springframework.data.repository.query.QueryLookupStrategy; import org.springframework.data.repository.query.QueryLookupStrategy.Key; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.RepositoryQuery; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -97,16 +97,16 @@ private static boolean isQueryDslRepository(Class repositoryInterface) { @Override protected Optional getQueryLookupStrategy(@Nullable Key key, - QueryMethodEvaluationContextProvider evaluationContextProvider) { - return Optional.of(new ElasticsearchQueryLookupStrategy(evaluationContextProvider)); + ValueExpressionDelegate valueExpressionDelegate) { + return Optional.of(new ElasticsearchQueryLookupStrategy(valueExpressionDelegate)); } private class ElasticsearchQueryLookupStrategy implements QueryLookupStrategy { - private final QueryMethodEvaluationContextProvider evaluationContextProvider; + private final ValueExpressionDelegate valueExpressionDelegate; - ElasticsearchQueryLookupStrategy(QueryMethodEvaluationContextProvider evaluationContextProvider) { - this.evaluationContextProvider = evaluationContextProvider; + ElasticsearchQueryLookupStrategy(ValueExpressionDelegate valueExpressionDelegate) { + this.valueExpressionDelegate = valueExpressionDelegate; } /* @@ -124,16 +124,16 @@ public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, if (namedQueries.hasQuery(namedQueryName)) { String namedQuery = namedQueries.getQuery(namedQueryName); return new RepositoryStringQuery(queryMethod, elasticsearchOperations, namedQuery, - evaluationContextProvider); + valueExpressionDelegate); } else if (queryMethod.hasAnnotatedQuery()) { return new RepositoryStringQuery(queryMethod, elasticsearchOperations, queryMethod.getAnnotatedQuery(), - evaluationContextProvider); + valueExpressionDelegate); } else if (queryMethod.hasAnnotatedSearchTemplateQuery()) { var searchTemplateQuery = queryMethod.getAnnotatedSearchTemplateQuery(); - return new RepositorySearchTemplateQuery(queryMethod, elasticsearchOperations, evaluationContextProvider, + return new RepositorySearchTemplateQuery(queryMethod, elasticsearchOperations, valueExpressionDelegate, searchTemplateQuery.id()); } - return new RepositoryPartQuery(queryMethod, elasticsearchOperations, evaluationContextProvider); + return new RepositoryPartQuery(queryMethod, elasticsearchOperations, valueExpressionDelegate); } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java index bf0080991..b8cfa930b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java @@ -18,6 +18,7 @@ import org.springframework.core.convert.ConversionService; import org.springframework.data.elasticsearch.repository.query.ElasticsearchParametersParameterAccessor; import org.springframework.data.elasticsearch.repository.support.spel.QueryStringSpELEvaluator; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.repository.query.QueryMethod; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.util.Assert; @@ -34,10 +35,10 @@ public class QueryStringProcessor { private final String query; private final QueryMethod queryMethod; private final ConversionService conversionService; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; + private final ValueEvaluationContextProvider evaluationContextProvider; public QueryStringProcessor(String query, QueryMethod queryMethod, ConversionService conversionService, - QueryMethodEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { Assert.notNull(query, "query must not be null"); Assert.notNull(queryMethod, "queryMethod must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java index a4808c78f..7e2607e6e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java @@ -26,7 +26,6 @@ import org.springframework.data.elasticsearch.repository.query.ReactivePartTreeElasticsearchQuery; import org.springframework.data.elasticsearch.repository.query.ReactiveRepositorySearchTemplateQuery; import org.springframework.data.elasticsearch.repository.query.ReactiveRepositoryStringQuery; -import org.springframework.data.elasticsearch.repository.query.RepositorySearchTemplateQuery; import org.springframework.data.elasticsearch.repository.support.querybyexample.ReactiveQueryByExampleElasticsearchExecutor; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.projection.ProjectionFactory; @@ -38,9 +37,9 @@ import org.springframework.data.repository.core.support.RepositoryFragment; import org.springframework.data.repository.query.QueryLookupStrategy; import org.springframework.data.repository.query.QueryLookupStrategy.Key; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor; import org.springframework.data.repository.query.RepositoryQuery; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -94,14 +93,10 @@ protected Object getTargetRepository(RepositoryInformation information) { return getTargetRepositoryViaReflection(information, entityInformation, operations); } - /* - * (non-Javadoc) - * @see org.springframework.data.repository.core.support.RepositoryFactorySupport#getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key, org.springframework.data.repository.query.EvaluationContextProvider) - */ @Override protected Optional getQueryLookupStrategy(@Nullable Key key, - QueryMethodEvaluationContextProvider evaluationContextProvider) { - return Optional.of(new ElasticsearchQueryLookupStrategy(operations, evaluationContextProvider, mappingContext)); + ValueExpressionDelegate valueExpressionDelegate) { + return Optional.of(new ElasticsearchQueryLookupStrategy(operations, valueExpressionDelegate, mappingContext)); } /* @@ -132,19 +127,19 @@ protected RepositoryMetadata getRepositoryMetadata(Class repositoryInterface) private static class ElasticsearchQueryLookupStrategy implements QueryLookupStrategy { private final ReactiveElasticsearchOperations operations; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; + private final ValueExpressionDelegate valueExpressionDelegate; private final MappingContext, ElasticsearchPersistentProperty> mappingContext; public ElasticsearchQueryLookupStrategy(ReactiveElasticsearchOperations operations, - QueryMethodEvaluationContextProvider evaluationContextProvider, + ValueExpressionDelegate valueExpressionDelegate, MappingContext, ElasticsearchPersistentProperty> mappingContext) { Assert.notNull(operations, "operations must not be null"); - Assert.notNull(evaluationContextProvider, "evaluationContextProvider must not be null"); + Assert.notNull(valueExpressionDelegate, "evaluationContextProvider must not be null"); Assert.notNull(mappingContext, "mappingContext must not be null"); this.operations = operations; - this.evaluationContextProvider = evaluationContextProvider; + this.valueExpressionDelegate = valueExpressionDelegate; this.mappingContext = mappingContext; } @@ -164,15 +159,15 @@ public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, String namedQuery = namedQueries.getQuery(namedQueryName); return new ReactiveRepositoryStringQuery(namedQuery, queryMethod, operations, - evaluationContextProvider); + valueExpressionDelegate); } else if (queryMethod.hasAnnotatedQuery()) { - return new ReactiveRepositoryStringQuery(queryMethod, operations, evaluationContextProvider); + return new ReactiveRepositoryStringQuery(queryMethod, operations, valueExpressionDelegate); } else if (queryMethod.hasAnnotatedSearchTemplateQuery()) { var searchTemplateQuery = queryMethod.getAnnotatedSearchTemplateQuery(); - return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, evaluationContextProvider, + return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, valueExpressionDelegate, searchTemplateQuery.id()); } else { - return new ReactivePartTreeElasticsearchQuery(queryMethod, operations, evaluationContextProvider); + return new ReactivePartTreeElasticsearchQuery(queryMethod, operations, valueExpressionDelegate); } } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java index 3d691d313..e40fa11dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java @@ -24,8 +24,8 @@ import org.springframework.data.elasticsearch.repository.support.value.ElasticsearchCollectionValueToStringConverter; import org.springframework.data.elasticsearch.repository.support.value.ElasticsearchQueryValueConversionService; import org.springframework.data.elasticsearch.repository.support.value.ElasticsearchStringValueToStringConverter; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; import org.springframework.expression.ParserContext; @@ -53,11 +53,11 @@ public class QueryStringSpELEvaluator { private final String queryString; private final ElasticsearchParametersParameterAccessor parameterAccessor; private final QueryMethod queryMethod; - private final QueryMethodEvaluationContextProvider evaluationContextProvider; + private final ValueEvaluationContextProvider evaluationContextProvider; private final TypeConverter elasticsearchSpELTypeConverter; public QueryStringSpELEvaluator(String queryString, ElasticsearchParametersParameterAccessor parameterAccessor, - QueryMethod queryMethod, QueryMethodEvaluationContextProvider evaluationContextProvider, + QueryMethod queryMethod, ValueEvaluationContextProvider evaluationContextProvider, ConversionService conversionService) { Assert.notNull(queryString, "queryString must not be null"); @@ -83,8 +83,8 @@ public String evaluate() { Expression expr = getQueryExpression(queryString); if (expr != null) { - EvaluationContext context = evaluationContextProvider.getEvaluationContext(parameterAccessor.getParameters(), - parameterAccessor.getValues()); + EvaluationContext context = evaluationContextProvider.getEvaluationContext(parameterAccessor.getValues()) + .getRequiredEvaluationContext(); if (context instanceof StandardEvaluationContext standardEvaluationContext) { standardEvaluationContext.setTypeConverter(elasticsearchSpELTypeConverter); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java index 5a55d9c86..65485868f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java @@ -36,6 +36,7 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; /** @@ -647,7 +648,7 @@ private String getQueryString(String methodName, Class[] parameterClasses, Ob new DefaultRepositoryMetadata(SampleRepository.class), new SpelAwareProxyProjectionFactory(), operations.getElasticsearchConverter().getMappingContext()); RepositoryPartQuery partQuery = new RepositoryPartQuery(queryMethod, operations, - QueryMethodEvaluationContextProvider.DEFAULT); + ValueExpressionDelegate.create()); Query query = partQuery.createQuery(parameters); return buildQueryString(query, Book.class); } diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java index af144dbc3..9572e8e3b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java @@ -28,7 +28,7 @@ import org.springframework.data.elasticsearch.core.SearchHits; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; public class ReactiveRepositorySearchTemplateQueryUnitTests extends ReactiveRepositoryQueryUnitTestsBase { @@ -71,7 +71,7 @@ private Query createQuery(String methodName, Object... args) throws NoSuchMethod } private ReactiveRepositorySearchTemplateQuery queryForMethod(ReactiveElasticsearchQueryMethod queryMethod) { - return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, QueryMethodEvaluationContextProvider.DEFAULT, + return new ReactiveRepositorySearchTemplateQuery(queryMethod, operations, ValueExpressionDelegate.create(), queryMethod.getAnnotatedSearchTemplateQuery().id()); } // endregion diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java index 11d7d6939..536dde273 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.springframework.data.repository.query.ValueExpressionDelegate; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -419,7 +420,7 @@ private ReactiveRepositoryStringQuery createQueryForMethod(String name, Class private ReactiveRepositoryStringQuery queryForMethod(ReactiveElasticsearchQueryMethod queryMethod) { return new ReactiveRepositoryStringQuery(queryMethod, operations, - QueryMethodEvaluationContextProvider.DEFAULT); + ValueExpressionDelegate.create()); } private interface SampleRepository extends Repository { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java index 1b0f62109..b3c346bf2 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java @@ -28,7 +28,7 @@ import org.springframework.data.elasticsearch.core.SearchHits; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; public class RepositorySearchTemplateQueryUnitTests extends RepositoryQueryUnitTestsBase { @@ -71,7 +71,7 @@ private Query createQuery(String methodName, Object... args) throws NoSuchMethod } private RepositorySearchTemplateQuery queryForMethod(ElasticsearchQueryMethod queryMethod) { - return new RepositorySearchTemplateQuery(queryMethod, operations, QueryMethodEvaluationContextProvider.DEFAULT, + return new RepositorySearchTemplateQuery(queryMethod, operations, ValueExpressionDelegate.create(), queryMethod.getAnnotatedSearchTemplateQuery().id()); } // endregion diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java index eebc20a04..68c36d7ca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java @@ -43,7 +43,7 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; import org.springframework.data.repository.Repository; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; +import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; /** @@ -407,7 +407,7 @@ void shouldUseConverterOnParameters() throws NoSuchMethodException { private RepositoryStringQuery queryForMethod(ElasticsearchQueryMethod queryMethod) { return new RepositoryStringQuery(queryMethod, operations, queryMethod.getAnnotatedQuery(), - QueryMethodEvaluationContextProvider.DEFAULT); + ValueExpressionDelegate.create()); } private interface SampleRepository extends Repository { From bd87dae1a3900350aae910a2e7def6b018334506 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 11 Feb 2025 12:47:00 +0100 Subject: [PATCH 069/131] Upgrade to Elasticsearch 8.17.1. Original Pull Request #3053 Closes #3052 Signed-off-by: Peter-Josef Meisch --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 747edaccb..e1411296d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.17.0 + 8.17.1 0.19.0 2.23.1 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 d4a1b35a2..d0cca4229 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.0. +* Upgrade to Elasticsearch 8.17.1. * Add support for the `@SearchTemplateQuery` annotation on repository methods. [[new-features.5-4-0]] diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 05533ddb6..455e02b11 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.0 | 6.2.x +| 2025.0 (in development) | 5.5.x | 8.17.1 | 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/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 073308e0c..92b24989f 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.0 +sde.testcontainers.image-version=8.17.1 # # # 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 From 7fe4d8e1a4cd36e4bbe57f0a101c5f88ad3aa79f Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 11 Feb 2025 15:23:14 +0100 Subject: [PATCH 070/131] Update CI Properties. See #3005 --- .mvn/extensions.xml | 2 +- .mvn/jvm.config | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .mvn/jvm.config diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 1e3bb355f..e0857eaa2 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -3,6 +3,6 @@ io.spring.develocity.conventions develocity-conventions-maven-extension - 0.0.19 + 0.0.22 diff --git a/.mvn/jvm.config b/.mvn/jvm.config new file mode 100644 index 000000000..32599cefe --- /dev/null +++ b/.mvn/jvm.config @@ -0,0 +1,10 @@ +--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED From f9f64e6b394a9219c79280edd756129016475aa4 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Wed, 12 Feb 2025 07:54:06 +0100 Subject: [PATCH 071/131] Upgrade to Elasticsearch 8.17.2. Closes #3054 Signed-off-by: Peter-Josef Meisch --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e1411296d..843be40fc 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.17.1 + 8.17.2 0.19.0 2.23.1 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 d0cca4229..5e11d4f92 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.1. +* Upgrade to Elasticsearch 8.17.2. * Add support for the `@SearchTemplateQuery` annotation on repository methods. [[new-features.5-4-0]] diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 455e02b11..7851acaf4 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.1 | 6.2.x +| 2025.0 (in development) | 5.5.x | 8.17.2 | 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/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 92b24989f..01b3d5e6f 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.1 +sde.testcontainers.image-version=8.17.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 From 846344891ddec7eabba688201f71c3fa46546557 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Feb 2025 12:22:19 +0100 Subject: [PATCH 072/131] Prepare 5.5 M1 (2025.0.0). See #3005 --- pom.xml | 14 ++------------ src/main/resources/notice.txt | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 843be40fc..f2f0f0f3d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-SNAPSHOT + 3.5.0-M1 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-SNAPSHOT + 3.5.0-M1 8.17.2 @@ -450,16 +450,6 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - spring-milestone https://repo.spring.io/milestone diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 2e344df6d..52ebfee2f 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.4 GA (2024.1.0) +Spring Data Elasticsearch 5.5 M1 (2025.0.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -25,3 +25,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 6d0825b1210abf0bf9630c337b535bd4d4070672 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Feb 2025 12:22:37 +0100 Subject: [PATCH 073/131] Release version 5.5 M1 (2025.0.0). See #3005 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f2f0f0f3d..b57d61caf 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-SNAPSHOT + 5.5.0-M1 org.springframework.data.build From 78ea67b6a657a740635300e1d7e0347c78aae338 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Feb 2025 12:25:08 +0100 Subject: [PATCH 074/131] Prepare next development iteration. See #3005 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b57d61caf..f2f0f0f3d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-M1 + 5.5.0-SNAPSHOT org.springframework.data.build From 15f086359d8d2370e23a6828f122d10adb3ccacf Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Feb 2025 12:25:09 +0100 Subject: [PATCH 075/131] After release cleanups. See #3005 --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f2f0f0f3d..843be40fc 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-M1 + 3.5.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-M1 + 3.5.0-SNAPSHOT 8.17.2 @@ -450,6 +450,16 @@ + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + spring-milestone https://repo.spring.io/milestone From 64f88ae9aca33d335ac2840f6bbbefe014cf4b7c Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Wed, 19 Feb 2025 20:14:16 +0100 Subject: [PATCH 076/131] Add testcontainers-local.properties handling. Original Pull Request #3062 Closes #3061 Signed-off-by: Peter-Josef Meisch --- .gitignore | 1 + .../data/elasticsearch/junit/jupiter/ClusterConnection.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 0b181452a..449f58ea4 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ node package-lock.json .mvn/.develocity +/src/test/resources/testcontainers-local.properties diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java index 2b2a6bf1e..8ac75d000 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java @@ -129,6 +129,9 @@ private ClusterConnectionInfo startElasticsearchContainer() { Map testcontainersProperties = testcontainersProperties( "testcontainers-" + testcontainersConfiguration + ".properties"); + var testcontainersPropertiesLocal = testcontainersProperties("testcontainers-local.properties"); + testcontainersProperties.putAll(testcontainersPropertiesLocal); + DockerImageName dockerImageName = getDockerImageName(testcontainersProperties); ElasticsearchContainer elasticsearchContainer = new SpringDataElasticsearchContainer(dockerImageName) From 8b43af2d333a294d334c09e2b44f7734d014c644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=B3=B4=EA=B5=90=20=28Bogus=20Jung=29?= Date: Fri, 21 Feb 2025 22:24:58 +0900 Subject: [PATCH 077/131] optimize capacity & add assert messages in GeoJson. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original Pull Request #3064 Closes #3063 Signed-off-by: 정보교 (Bogus Jung) --- .../data/elasticsearch/core/geo/GeoJson.java | 2 +- .../data/elasticsearch/core/geo/GeoJsonLineString.java | 4 ++-- .../data/elasticsearch/core/geo/GeoJsonMultiPoint.java | 4 ++-- .../data/elasticsearch/core/geo/GeoJsonPolygon.java | 8 +++++++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java index 20c312303..02494d190 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java @@ -21,7 +21,7 @@ /** * Interface definition for structures defined in GeoJSON - * format. copied from Spring Data Mongodb + * format. copied from Spring Data Mongodb * * @author Christoph Strobl * @since 1.7 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java index 5c848e90b..bea76baf6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java @@ -69,7 +69,7 @@ public static GeoJsonLineString of(Point first, Point second, Point... others) { Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); - List points = new ArrayList<>(); + List points = new ArrayList<>(2 + others.length); points.add(first); points.add(second); points.addAll(Arrays.asList(others)); @@ -103,7 +103,7 @@ public static GeoJsonLineString of(GeoPoint first, GeoPoint second, GeoPoint... Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); - List points = new ArrayList<>(); + List points = new ArrayList<>(2 + others.length); points.add(GeoPoint.toPoint(first)); points.add(GeoPoint.toPoint(second)); points.addAll(Arrays.stream(others).map(GeoPoint::toPoint).collect(Collectors.toList())); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java index d81e30f52..410149b1c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java @@ -69,7 +69,7 @@ public static GeoJsonMultiPoint of(Point first, Point second, Point... others) { Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); - List points = new ArrayList<>(); + List points = new ArrayList<>(2 + others.length); points.add(first); points.add(second); points.addAll(Arrays.asList(others)); @@ -103,7 +103,7 @@ public static GeoJsonMultiPoint of(GeoPoint first, GeoPoint second, GeoPoint... Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); - List points = new ArrayList<>(); + List points = new ArrayList<>(2 + others.length); points.add(GeoPoint.toPoint(first)); points.add(GeoPoint.toPoint(second)); points.addAll(Arrays.stream(others).map(GeoPoint::toPoint).collect(Collectors.toList())); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java index ffc613b30..2b8a6d879 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java @@ -189,7 +189,13 @@ public List getCoordinates() { @SafeVarargs private static List asList(T first, T second, T third, T fourth, T... others) { - ArrayList result = new ArrayList<>(3 + others.length); + Assert.notNull(first, "First element must not be null!"); + Assert.notNull(second, "Second element must not be null!"); + Assert.notNull(third, "Third element must not be null!"); + Assert.notNull(fourth, "Fourth element must not be null!"); + Assert.notNull(others, "Additional elements must not be null!"); + + ArrayList result = new ArrayList<>(4 + others.length); result.add(first); result.add(second); From fa979249fcd99e01da2d53ff3ab22085b7eb5e68 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 23 Feb 2025 12:37:26 +0100 Subject: [PATCH 078/131] Remove deprecated methods. Original Pull Request #3067 Closes #3066 Signed-off-by: Peter-Josef Meisch --- .../migration-guide-5.4-5.5.adoc | 8 ++++++ .../client/elc/ElasticsearchTemplate.java | 13 ---------- .../elc/ReactiveElasticsearchTemplate.java | 10 ------- .../core/AbstractElasticsearchTemplate.java | 6 ----- ...AbstractReactiveElasticsearchTemplate.java | 6 ----- .../core/DocumentOperations.java | 26 ------------------- .../core/ReactiveDocumentOperations.java | 23 ---------------- .../SimpleElasticsearchRepository.java | 2 +- 8 files changed, 9 insertions(+), 85 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc index 494f6601f..38b2b4af2 100644 --- a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.4-5.5.adoc @@ -20,3 +20,11 @@ Some classes that probably are not used by a library user have been renamed, the |=== === Removals + +The following methods that had been deprecated since release 5.3 have been removed: +``` +DocumentOperations.delete(Query, Class) +DocumentOperations.delete(Query, Class, IndexCoordinates) +ReactiveDocumentOperations.delete(Query, Class) +ReactiveDocumentOperations.delete(Query, Class, IndexCoordinates) +``` diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java index 58230a3a2..70b76bc5b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java @@ -181,19 +181,6 @@ public ByQueryResponse delete(DeleteQuery query, Class clazz) { return delete(query, clazz, getIndexCoordinatesFor(clazz)); } - @Override - public ByQueryResponse delete(Query query, Class clazz, IndexCoordinates index) { - - Assert.notNull(query, "query must not be null"); - - DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(), - clazz, index, getRefreshPolicy()); - - DeleteByQueryResponse response = execute(client -> client.deleteByQuery(request)); - - return responseConverter.byQueryResponse(response); - } - @Override public ByQueryResponse delete(DeleteQuery query, Class clazz, IndexCoordinates index) { Assert.notNull(query, "query must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index f2d2cc158..78bd2213a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -167,16 +167,6 @@ protected Mono doExists(String id, IndexCoordinates index) { .onErrorReturn(NoSuchIndexException.class, false); } - @Override - public Mono delete(Query query, Class entityType, IndexCoordinates index) { - - Assert.notNull(query, "query must not be null"); - - DeleteByQueryRequest request = requestConverter.documentDeleteByQueryRequest(query, routingResolver.getRouting(), - entityType, index, getRefreshPolicy()); - return Mono.from(execute(client -> client.deleteByQuery(request))).map(responseConverter::byQueryResponse); - } - @Override public Mono delete(DeleteQuery query, Class entityType, IndexCoordinates index) { Assert.notNull(query, "query must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java index 387d26e6b..d6074a4fa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java @@ -298,12 +298,6 @@ public String delete(String id, Class entityType) { return this.delete(id, getIndexCoordinatesFor(entityType)); } - @Override - @Deprecated - public ByQueryResponse delete(Query query, Class clazz) { - return delete(query, clazz, getIndexCoordinatesFor(clazz)); - } - @Override public String delete(Object entity) { return delete(entity, getIndexCoordinatesFor(entity.getClass())); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java index efa91084f..3fee5f2db 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java @@ -408,12 +408,6 @@ public Mono delete(String id, IndexCoordinates index) { abstract protected Mono doDeleteById(String id, @Nullable String routing, IndexCoordinates index); - @Override - @Deprecated - public Mono delete(Query query, Class entityType) { - return delete(query, entityType, getIndexCoordinatesFor(entityType)); - } - @Override public Mono delete(DeleteQuery query, Class entityType) { return delete(query, entityType, getIndexCoordinatesFor(entityType)); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java index 84f855ef5..d855b0a6a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java @@ -272,19 +272,6 @@ default void bulkUpdate(List queries, IndexCoordinates index) { */ String delete(Object entity, IndexCoordinates index); - /** - * Delete all records matching the query. - * - * @param query query defining the objects - * @param clazz The entity class, must be annotated with - * {@link org.springframework.data.elasticsearch.annotations.Document} - * @return response with detailed information - * @since 4.1 - * @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)} - */ - @Deprecated - ByQueryResponse delete(Query query, Class clazz); - /** * Delete all records matching the query. * @@ -296,19 +283,6 @@ default void bulkUpdate(List queries, IndexCoordinates index) { */ ByQueryResponse delete(DeleteQuery query, Class clazz); - /** - * Delete all records matching the query. - * - * @param query query defining the objects - * @param clazz The entity class, must be annotated with - * {@link org.springframework.data.elasticsearch.annotations.Document} - * @param index the index from which to delete - * @return response with detailed information - * @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)} - */ - @Deprecated - ByQueryResponse delete(Query query, Class clazz, IndexCoordinates index); - /** * Delete all records matching the query. * diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java index 4614f6d25..dba06262c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java @@ -326,17 +326,6 @@ default Mono bulkUpdate(List queries, IndexCoordinates index) */ Mono delete(String id, Class entityType); - /** - * Delete the documents matching the given {@link Query} extracting index from entity metadata. - * - * @param query must not be {@literal null}. - * @param entityType must not be {@literal null}. - * @return a {@link Mono} emitting the number of the removed documents. - * @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class)} - */ - @Deprecated - Mono delete(Query query, Class entityType); - /** * Delete the documents matching the given {@link Query} extracting index from entity metadata. * @@ -347,18 +336,6 @@ default Mono bulkUpdate(List queries, IndexCoordinates index) */ Mono delete(DeleteQuery query, Class entityType); - /** - * Delete the documents matching the given {@link Query} extracting index from entity metadata. - * - * @param query must not be {@literal null}. - * @param entityType must not be {@literal null}. - * @param index the target index, must not be {@literal null} - * @return a {@link Mono} emitting the number of the removed documents. - * @deprecated since 5.3.0, use {@link #delete(DeleteQuery, Class, IndexCoordinates)} - */ - @Deprecated - Mono delete(Query query, Class entityType, IndexCoordinates index); - /** * Delete the documents matching the given {@link Query} extracting index from entity metadata. * diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index e58d9cc76..54a0928cc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -384,7 +384,7 @@ private void doDelete(@Nullable ID id, @Nullable String routing, IndexCoordinate public void deleteAll() { executeAndRefresh((OperationsCallback) operations -> { - operations.delete(Query.findAll(), entityClass, getIndexCoordinates()); + operations.delete(DeleteQuery.builder(Query.findAll()).build(), entityClass, getIndexCoordinates()); return null; }); } From 89f60f23568579015f08d62afb6e3517e28ad156 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Sun, 2 Mar 2025 10:45:59 +0200 Subject: [PATCH 079/131] Fix typo. Original Pull Request #3069 Closes: #3068 Signed-off-by: Dgray16 --- .../data/elasticsearch/core/query/SourceFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java index d981cf80b..150cffb77 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java @@ -20,7 +20,7 @@ /** * SourceFilter for providing includes and excludes. Using these helps in reducing the amount of data that is returned - * from Elasticsearch especially when the stored docuements are large and only some fields from these documents are + * from Elasticsearch especially when the stored documents are large and only some fields from these documents are * needed. If the SourceFilter includes the name of a property that has a different name mapped in Elasticsearch (see * {@link Field#name()} this will automatically be mapped. * From 35e7b45f1a988133c7b70a968ca673fc7ac233b0 Mon Sep 17 00:00:00 2001 From: Hope Kim Date: Wed, 5 Mar 2025 03:25:25 +0900 Subject: [PATCH 080/131] Fix syntax errors in link formatting in adoc files. Original Pull Request: #3070 Closes #3071 Signed-off-by: esperar --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 2eaf7aeaa..0242089d8 100644 --- a/README.adoc +++ b/README.adoc @@ -62,7 +62,7 @@ public class MyService { === Using the RestClient -Please check the [official documentation](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration). +Please check the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration[official documentation]. === Maven configuration From 42383624eadc79cdee0f564ad30c89d3eb486ae2 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 9 Mar 2025 12:31:59 +0100 Subject: [PATCH 081/131] Fix mapping of property names in sort parameters. Original Pull Request #3074 Closes #3072 Signed-off-by: Peter-Josef Meisch --- .../MappingElasticsearchConverter.java | 63 +++++++++++----- .../RepositoryPartQueryIntegrationTests.java | 71 ++++++++++++++++++- 2 files changed, 117 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index f196263d2..d33cef5c3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -38,6 +38,7 @@ import org.springframework.core.env.EnvironmentCapable; import org.springframework.core.env.StandardEnvironment; import org.springframework.data.convert.CustomConversions; +import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.ScriptedField; import org.springframework.data.elasticsearch.core.document.Document; @@ -50,6 +51,7 @@ import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import org.springframework.data.elasticsearch.core.query.FetchSourceFilter; import org.springframework.data.elasticsearch.core.query.Field; +import org.springframework.data.elasticsearch.core.query.Order; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm; import org.springframework.data.elasticsearch.core.query.SourceFilter; @@ -1231,7 +1233,7 @@ public void updateQuery(Query query, @Nullable Class domainClass) { return; } - updatePropertiesInFieldsAndSourceFilter(query, domainClass); + updatePropertiesInFieldsSortAndSourceFilter(query, domainClass); if (query instanceof CriteriaQuery criteriaQuery) { updatePropertiesInCriteriaQuery(criteriaQuery, domainClass); @@ -1242,7 +1244,14 @@ public void updateQuery(Query query, @Nullable Class domainClass) { } } - private void updatePropertiesInFieldsAndSourceFilter(Query query, Class domainClass) { + /** + * replaces the names of fields in the query, the sort or soucre filters with the field names used in Elasticsearch + * when they are defined on the ElasticsearchProperties + * + * @param query the query to process + * @param domainClass the domain class (persistent entity) + */ + private void updatePropertiesInFieldsSortAndSourceFilter(Query query, Class domainClass) { ElasticsearchPersistentEntity persistentEntity = mappingContext.getPersistentEntity(domainClass); @@ -1250,12 +1259,12 @@ private void updatePropertiesInFieldsAndSourceFilter(Query query, Class domai List fields = query.getFields(); if (!fields.isEmpty()) { - query.setFields(updateFieldNames(fields, persistentEntity)); + query.setFields(propertyToFieldNames(fields, persistentEntity)); } List storedFields = query.getStoredFields(); if (!CollectionUtils.isEmpty(storedFields)) { - query.setStoredFields(updateFieldNames(storedFields, persistentEntity)); + query.setStoredFields(propertyToFieldNames(storedFields, persistentEntity)); } SourceFilter sourceFilter = query.getSourceFilter(); @@ -1266,37 +1275,60 @@ private void updatePropertiesInFieldsAndSourceFilter(Query query, Class domai String[] excludes = null; if (sourceFilter.getIncludes() != null) { - includes = updateFieldNames(Arrays.asList(sourceFilter.getIncludes()), persistentEntity) + includes = propertyToFieldNames(Arrays.asList(sourceFilter.getIncludes()), persistentEntity) .toArray(new String[] {}); } if (sourceFilter.getExcludes() != null) { - excludes = updateFieldNames(Arrays.asList(sourceFilter.getExcludes()), persistentEntity) + excludes = propertyToFieldNames(Arrays.asList(sourceFilter.getExcludes()), persistentEntity) .toArray(new String[] {}); } query.addSourceFilter(new FetchSourceFilter(sourceFilter.fetchSource(), includes, excludes)); } + + if (query.getSort() != null) { + var sort = query.getSort(); + // stream the orders and map them to a new order with the changed names, + // then replace the existing sort with a new sort containing the new orders. + var newOrders = sort.stream().map(order -> { + var fieldNames = updateFieldNames(order.getProperty(), persistentEntity); + + if (order instanceof Order springDataElasticsearchOrder) { + return springDataElasticsearchOrder.withProperty(fieldNames); + } else { + return new Sort.Order(order.getDirection(), + fieldNames, + order.isIgnoreCase(), + order.getNullHandling()); + } + }).toList(); + + if (query instanceof BaseQuery baseQuery) { + baseQuery.setSort(Sort.by(newOrders)); + } + } } } /** - * relaces the fieldName with the property name of a property of the persistentEntity with the corresponding - * fieldname. If no such property exists, the original fieldName is kept. + * replaces property name of a property of the persistentEntity with the corresponding fieldname. If no such property + * exists, the original fieldName is kept. * - * @param fieldNames list of fieldnames + * @param propertyNames list of fieldnames * @param persistentEntity the persistent entity to check * @return an updated list of field names */ - private List updateFieldNames(List fieldNames, ElasticsearchPersistentEntity persistentEntity) { - return fieldNames.stream().map(fieldName -> updateFieldName(persistentEntity, fieldName)) + private List propertyToFieldNames(List propertyNames, + ElasticsearchPersistentEntity persistentEntity) { + return propertyNames.stream().map(propertyName -> propertyToFieldName(persistentEntity, propertyName)) .collect(Collectors.toList()); } @NotNull - private String updateFieldName(ElasticsearchPersistentEntity persistentEntity, String fieldName) { - ElasticsearchPersistentProperty persistentProperty = persistentEntity.getPersistentProperty(fieldName); - return persistentProperty != null ? persistentProperty.getFieldName() : fieldName; + private String propertyToFieldName(ElasticsearchPersistentEntity persistentEntity, String propertyName) { + ElasticsearchPersistentProperty persistentProperty = persistentEntity.getPersistentProperty(propertyName); + return persistentProperty != null ? persistentProperty.getFieldName() : propertyName; } private void updatePropertiesInCriteriaQuery(CriteriaQuery criteriaQuery, Class domainClass) { @@ -1410,7 +1442,7 @@ public String updateFieldNames(String propertyPath, ElasticsearchPersistentEntit if (properties.length > 0) { var propertyName = properties[0]; - var fieldName = updateFieldName(persistentEntity, propertyName); + var fieldName = propertyToFieldName(persistentEntity, propertyName); if (properties.length > 1) { var persistentProperty = persistentEntity.getPersistentProperty(propertyName); @@ -1431,7 +1463,6 @@ public String updateFieldNames(String propertyPath, ElasticsearchPersistentEntit } } - // endregion @SuppressWarnings("ClassCanBeRecord") diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java index 65485868f..e73fe780c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.List; import org.json.JSONException; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.repository.query.RepositoryPartQuery; import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.lang.Nullable; @@ -640,6 +640,45 @@ void findByAvailableTrueOrderByNameDesc() throws NoSuchMethodException, JSONExce assertEquals(expected, query, false); } + @Test // #3072 + @DisplayName("should build sort object with correct field names") + void shouldBuildSortObjectWithCorrectFieldNames() throws NoSuchMethodException, JSONException { + + String methodName = "findByNameOrderBySortAuthor_SortName"; + Class[] parameterClasses = new Class[] { String.class }; + Object[] parameters = new Object[] { BOOK_TITLE }; + + String query = getQueryString(methodName, parameterClasses, parameters); + + String expected = """ + + { + "query": { + "bool": { + "must": [ + { + "query_string": { + "query": "Title", + "fields": [ + "name" + ] + } + } + ] + } + }, + "sort": [ + { + "sort_author.sort_name": { + "order": "asc" + } + } + ] + }"""; + + assertEquals(expected, query, false); + } + private String getQueryString(String methodName, Class[] parameterClasses, Object[] parameters) throws NoSuchMethodException { @@ -727,6 +766,8 @@ private interface SampleRepository extends ElasticsearchRepository List findByAvailableTrueOrderByNameDesc(); + List findByNameOrderBySortAuthor_SortName(String name); + } public static class Book { @@ -736,6 +777,10 @@ public static class Book { @Nullable private Integer price; @Field(type = FieldType.Boolean) private boolean available; + // this is needed for the #3072 test + @Nullable + @Field(name = "sort_author", type = FieldType.Object) private Author sortAuthor; + @Nullable public String getId() { return id; @@ -767,8 +812,32 @@ public Boolean getAvailable() { return available; } + @Nullable + public Author getSortAuthor() { + return sortAuthor; + } + + public void setSortAuthor(@Nullable Author sortAuthor) { + this.sortAuthor = sortAuthor; + } + public void setAvailable(Boolean available) { this.available = available; + + } + } + + public static class Author { + @Nullable + @Field(name = "sort_name", type = FieldType.Keyword) private String sortName; + + @Nullable + public String getSortName() { + return sortName; + } + + public void setSortName(@Nullable String sortName) { + this.sortName = sortName; } } } From ace17b9751170c95f6a7bc8eb59afd1e1c190be8 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Mar 2025 09:30:46 +0100 Subject: [PATCH 082/131] Prepare 5.5 M2 (2025.0.0). See #3058 --- pom.xml | 14 ++------------ src/main/resources/notice.txt | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 843be40fc..c594e5163 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-SNAPSHOT + 3.5.0-M2 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-SNAPSHOT + 3.5.0-M2 8.17.2 @@ -450,16 +450,6 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - spring-milestone https://repo.spring.io/milestone diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 52ebfee2f..81abb2cfe 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.5 M1 (2025.0.0) +Spring Data Elasticsearch 5.5 M2 (2025.0.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -26,3 +26,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 1fdee7399f7e224e324a5d0faeb578abc24f3dfb Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Mar 2025 09:31:05 +0100 Subject: [PATCH 083/131] Release version 5.5 M2 (2025.0.0). See #3058 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c594e5163..d959e9cd5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-SNAPSHOT + 5.5.0-M2 org.springframework.data.build From 300fe2ac8b2d303ec6260b3f43817d30fef35db0 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Mar 2025 09:33:42 +0100 Subject: [PATCH 084/131] Prepare next development iteration. See #3058 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d959e9cd5..c594e5163 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-M2 + 5.5.0-SNAPSHOT org.springframework.data.build From 6f424318eca2bccd2a6169433b29c0cfbdba48e8 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 14 Mar 2025 09:33:43 +0100 Subject: [PATCH 085/131] After release cleanups. See #3058 --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c594e5163..843be40fc 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-M2 + 3.5.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-M2 + 3.5.0-SNAPSHOT 8.17.2 @@ -450,6 +450,16 @@ + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + spring-milestone https://repo.spring.io/milestone From 2366f67bba249cdaa540ef98de8932997d0b4361 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Tue, 18 Mar 2025 20:24:02 +0100 Subject: [PATCH 086/131] Enable scripted fields and runtime fields of collection type. Original Pull Request #3080 Closes #3076 Signed-off-by: Peter-Josef Meisch --- .../elasticsearch/elasticsearch-new.adoc | 1 + .../MappingElasticsearchConverter.java | 22 ++- .../core/document/SearchDocument.java | 14 ++ ...iptedAndRuntimeFieldsIntegrationTests.java | 158 ++++++++++++++---- src/test/resources/runtime-fields-person.json | 7 + 5 files changed, 169 insertions(+), 33 deletions(-) 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 5e11d4f92..887dc49de 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -6,6 +6,7 @@ * Upgrade to Elasticsearch 8.17.2. * Add support for the `@SearchTemplateQuery` annotation on repository methods. +* Scripted field properties of type collection can be populated from scripts returning arrays. [[new-features.5-4-0]] == New in Spring Data Elasticsearch 5.4 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index d33cef5c3..ff564f7b7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -394,7 +394,7 @@ private R readEntity(ElasticsearchPersistentEntity entity, Map target) { return conversionService.convert(value, target); } - private void populateScriptFields(ElasticsearchPersistentEntity entity, T result, + /** + * Checks if any of the properties of the entity is annotated with + * + * @{@link ScriptedField}. If so, the value of this property is set from the returned fields in the document. + * @param entity the entity to defining the persistent property + * @param result the rsult to populate + * @param searchDocument the search result caontaining the fields + * @param the result type + */ + private void populateScriptedFields(ElasticsearchPersistentEntity entity, T result, SearchDocument searchDocument) { Map> fields = searchDocument.getFields(); entity.doWithProperties((SimplePropertyHandler) property -> { @@ -661,8 +670,13 @@ private void populateScriptFields(ElasticsearchPersistentEntity entity, T // noinspection ConstantConditions String name = scriptedField.name().isEmpty() ? property.getName() : scriptedField.name(); if (fields.containsKey(name)) { - Object value = searchDocument.getFieldValue(name); - entity.getPropertyAccessor(result).setProperty(property, value); + if (property.isCollectionLike()) { + List values = searchDocument.getFieldValues(name); + entity.getPropertyAccessor(result).setProperty(property, values); + } else { + Object value = searchDocument.getFieldValue(name); + entity.getPropertyAccessor(result).setProperty(property, value); + } } } }); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java index d98c68524..2fb158f29 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java @@ -57,6 +57,20 @@ default V getFieldValue(final String name) { return (V) values.get(0); } + /** + * @param name the field name + * @param the type of elements + * @return the values of the given field. + */ + @Nullable + default List getFieldValues(final String name) { + List values = getFields().get(name); + if (values == null) { + return null; + } + return (List) values; + } + /** * @return the sort values for the search hit */ diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java index 9d05a240c..14cedf76b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java @@ -99,6 +99,8 @@ void shouldUseRuntimeFieldFromQueryInSearch() { @DisplayName("should use runtime-field without script") void shouldUseRuntimeFieldWithoutScript() { + // a runtime field without a script can be used to redefine the type of a field for the search, + // here we change the type from text to double insert("1", "11", 10); Query query = new CriteriaQuery(new Criteria("description").matches(11.0)); RuntimeField runtimeField = new RuntimeField("description", "double"); @@ -133,6 +135,25 @@ void shouldReturnValueFromRuntimeFieldDefinedInMapping() { assertThat(foundPerson.getBirthDate()).isEqualTo(birthDate); } + @Test // #3076 + @DisplayName("should return scripted fields that are lists") + void shouldReturnScriptedFieldsThatAreLists() { + var person = new Person(); + person.setFirstName("John"); + person.setLastName("Doe"); + operations.save(person); + var query = Query.findAll(); + query.addFields("allNames"); + query.addSourceFilter(new FetchSourceFilterBuilder().withIncludes("*").build()); + + var searchHits = operations.search(query, Person.class); + + assertThat(searchHits.getTotalHits()).isEqualTo(1); + var foundPerson = searchHits.getSearchHit(0).getContent(); + // the painless script seems to return the data sorted no matter in which order the values are emitted + assertThat(foundPerson.getAllNames()).containsExactlyInAnyOrderElementsOf(List.of("John", "Doe")); + } + @Test // #2035 @DisplayName("should use repository method with ScriptedField parameters") void shouldUseRepositoryMethodWithScriptedFieldParameters() { @@ -143,9 +164,11 @@ void shouldUseRepositoryMethodWithScriptedFieldParameters() { repository.save(entity); - org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField1 = getScriptedField("scriptedValue1", + org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField1 = buildScriptedField( + "scriptedValue1", 2); - org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField2 = getScriptedField("scriptedValue2", + org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField2 = buildScriptedField( + "scriptedValue2", 3); var searchHits = repository.findByValue(3, scriptedField1, scriptedField2); @@ -157,17 +180,6 @@ void shouldUseRepositoryMethodWithScriptedFieldParameters() { assertThat(foundEntity.getScriptedValue2()).isEqualTo(9); } - @NotNull - private static org.springframework.data.elasticsearch.core.query.ScriptedField getScriptedField(String fieldName, - int factor) { - return org.springframework.data.elasticsearch.core.query.ScriptedField.of( - fieldName, - ScriptData.of(b -> b - .withType(ScriptType.INLINE) - .withScript("doc['value'].size() > 0 ? doc['value'].value * params['factor'] : 0") - .withParams(Map.of("factor", factor)))); - } - @Test // #2035 @DisplayName("should use repository string query method with ScriptedField parameters") void shouldUseRepositoryStringQueryMethodWithScriptedFieldParameters() { @@ -178,9 +190,11 @@ void shouldUseRepositoryStringQueryMethodWithScriptedFieldParameters() { repository.save(entity); - org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField1 = getScriptedField("scriptedValue1", + org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField1 = buildScriptedField( + "scriptedValue1", 2); - org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField2 = getScriptedField("scriptedValue2", + org.springframework.data.elasticsearch.core.query.ScriptedField scriptedField2 = buildScriptedField( + "scriptedValue2", 3); var searchHits = repository.findWithScriptedFields(3, scriptedField1, scriptedField2); @@ -202,8 +216,8 @@ void shouldUseRepositoryMethodWithRuntimeFieldParameters() { repository.save(entity); - var runtimeField1 = getRuntimeField("scriptedValue1", 3); - var runtimeField2 = getRuntimeField("scriptedValue2", 4); + var runtimeField1 = buildRuntimeField("scriptedValue1", 3); + var runtimeField2 = buildRuntimeField("scriptedValue2", 4); var searchHits = repository.findByValue(3, runtimeField1, runtimeField2); @@ -214,14 +228,6 @@ void shouldUseRepositoryMethodWithRuntimeFieldParameters() { assertThat(foundEntity.getScriptedValue2()).isEqualTo(12); } - @NotNull - private static RuntimeField getRuntimeField(String fieldName, int factor) { - return new RuntimeField( - fieldName, - "long", - String.format("emit(doc['value'].size() > 0 ? doc['value'].value * %d : 0)", factor)); - } - @Test // #2035 @DisplayName("should use repository string query method with RuntimeField parameters") void shouldUseRepositoryStringQueryMethodWithRuntimeFieldParameters() { @@ -232,8 +238,8 @@ void shouldUseRepositoryStringQueryMethodWithRuntimeFieldParameters() { repository.save(entity); - var runtimeField1 = getRuntimeField("scriptedValue1", 3); - var runtimeField2 = getRuntimeField("scriptedValue2", 4); + var runtimeField1 = buildRuntimeField("scriptedValue1", 3); + var runtimeField2 = buildRuntimeField("scriptedValue2", 4); var searchHits = repository.findWithRuntimeFields(3, runtimeField1, runtimeField2); @@ -263,8 +269,7 @@ void shouldUseParametersForRuntimeFieldsInSearchQueries() { "priceWithTax", "double", "emit(doc['price'].value * params.tax)", - Map.of("tax", 1.19) - ); + Map.of("tax", 1.19)); var query = CriteriaQuery.builder( Criteria.where("priceWithTax").greaterThan(100.0)) .withRuntimeFields(List.of(runtimeField)) @@ -275,6 +280,56 @@ void shouldUseParametersForRuntimeFieldsInSearchQueries() { assertThat(searchHits).hasSize(1); } + @Test // #3076 + @DisplayName("should use runtime fields in queries returning lists") + void shouldUseRuntimeFieldsInQueriesReturningLists() { + + insert("1", "item 1", 80.0); + + var runtimeField = new RuntimeField( + "someStrings", + "keyword", + "emit('foo'); emit('bar');", + null); + + var query = Query.findAll(); + query.addRuntimeField(runtimeField); + query.addFields("someStrings"); + query.addSourceFilter(new FetchSourceFilterBuilder().withIncludes("*").build()); + + var searchHits = operations.search(query, SomethingToBuy.class); + + assertThat(searchHits).hasSize(1); + var somethingToBuy = searchHits.getSearchHit(0).getContent(); + assertThat(somethingToBuy.someStrings).containsExactlyInAnyOrder("foo", "bar"); + } + + /** + * build a {@link org.springframework.data.elasticsearch.core.query.ScriptedField} to return the product of the + * document's value property and the given factor + */ + @NotNull + private static org.springframework.data.elasticsearch.core.query.ScriptedField buildScriptedField(String fieldName, + int factor) { + return org.springframework.data.elasticsearch.core.query.ScriptedField.of( + fieldName, + ScriptData.of(b -> b + .withType(ScriptType.INLINE) + .withScript("doc['value'].size() > 0 ? doc['value'].value * params['factor'] : 0") + .withParams(Map.of("factor", factor)))); + } + + /** + * build a {@link RuntimeField} to return the product of the document's value property and the given factor + */ + @NotNull + private static RuntimeField buildRuntimeField(String fieldName, int factor) { + return new RuntimeField( + fieldName, + "long", + String.format("emit(doc['value'].size() > 0 ? doc['value'].value * %d : 0)", factor)); + } + @SuppressWarnings("unused") @Document(indexName = "#{@indexNameProvider.indexName()}-something-to-by") private static class SomethingToBuy { @@ -286,6 +341,9 @@ private static class SomethingToBuy { @Nullable @Field(type = FieldType.Double) private Double price; + @Nullable + @ScriptedField private List someStrings; + @Nullable public String getId() { return id; @@ -312,6 +370,15 @@ public Double getPrice() { public void setPrice(@Nullable Double price) { this.price = price; } + + @Nullable + public List getSomeStrings() { + return someStrings; + } + + public void setSomeStrings(@Nullable List someStrings) { + this.someStrings = someStrings; + } } @SuppressWarnings("unused") @@ -320,6 +387,13 @@ public void setPrice(@Nullable Double price) { public static class Person { @Nullable private String id; + // need keywords as we are using them in the script + @Nullable + @Field(type = FieldType.Keyword) private String firstName; + @Nullable + @Field(type = FieldType.Keyword) private String lastName; + @ScriptedField private List allNames = List.of(); + @Field(type = FieldType.Date, format = DateFormat.basic_date) @Nullable private LocalDate birthDate; @@ -335,6 +409,24 @@ public void setId(@Nullable String id) { this.id = id; } + @Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@Nullable String firstName) { + this.firstName = firstName; + } + + @Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@Nullable String lastName) { + this.lastName = lastName; + } + @Nullable public LocalDate getBirthDate() { return birthDate; @@ -352,6 +444,14 @@ public Integer getAge() { public void setAge(@Nullable Integer age) { this.age = age; } + + public List getAllNames() { + return allNames; + } + + public void setAllNames(List allNames) { + this.allNames = allNames; + } } @SuppressWarnings("unused") diff --git a/src/test/resources/runtime-fields-person.json b/src/test/resources/runtime-fields-person.json index 85f24d964..f225e02a0 100644 --- a/src/test/resources/runtime-fields-person.json +++ b/src/test/resources/runtime-fields-person.json @@ -5,5 +5,12 @@ "lang": "painless", "source": "Instant currentDate = Instant.ofEpochMilli(new Date().getTime()); Instant startDate = doc['birthDate'].value.toInstant(); emit(ChronoUnit.DAYS.between(startDate, currentDate) / 365);" } + }, + "allNames": { + "type": "keyword", + "script": { + "lang": "painless", + "source": "emit(doc['firstName'].value);emit(doc['lastName'].value);" + } } } From 1ae6301c2f7a4c659c59f0fe3b164114d3c45dc0 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Mon, 24 Mar 2025 21:44:53 +0100 Subject: [PATCH 087/131] Fix cutting of unknown properties in property paths for search. Original Pull Request #3082 Closes #3081 Signed-off-by: Peter-Josef Meisch --- .../MappingElasticsearchConverter.java | 116 +++++++++--------- .../RepositoryPartQueryIntegrationTests.java | 42 +++++++ 2 files changed, 101 insertions(+), 57 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index ff564f7b7..441a95c53 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -1372,53 +1372,21 @@ private void updatePropertiesInCriteria(Criteria criteria, ElasticsearchPersiste return; } - String[] fieldNames = field.getName().split("\\."); - - ElasticsearchPersistentEntity currentEntity = persistentEntity; - ElasticsearchPersistentProperty persistentProperty = null; - int propertyCount = 0; - boolean isNested = false; - - for (int i = 0; i < fieldNames.length; i++) { - persistentProperty = currentEntity.getPersistentProperty(fieldNames[i]); - - if (persistentProperty != null) { - propertyCount++; - fieldNames[i] = persistentProperty.getFieldName(); - - org.springframework.data.elasticsearch.annotations.Field fieldAnnotation = persistentProperty - .findAnnotation(org.springframework.data.elasticsearch.annotations.Field.class); - - if (fieldAnnotation != null && fieldAnnotation.type() == FieldType.Nested) { - isNested = true; - } - - try { - currentEntity = mappingContext.getPersistentEntity(persistentProperty.getActualType()); - } catch (Exception e) { - // using system types like UUIDs will lead to java.lang.reflect.InaccessibleObjectException in JDK 16 - // so if we cannot get an entity here, bail out. - currentEntity = null; - } - } - - if (currentEntity == null) { - break; - } - } + var propertyNamesUpdate = updatePropertyNames(persistentEntity, field.getName()); + var fieldNames = propertyNamesUpdate.names(); field.setName(String.join(".", fieldNames)); - if (propertyCount > 1 && isNested) { + if (propertyNamesUpdate.propertyCount() > 1 && propertyNamesUpdate.nestedProperty()) { List propertyNames = Arrays.asList(fieldNames); - field.setPath(String.join(".", propertyNames.subList(0, propertyCount - 1))); + field.setPath(String.join(".", propertyNames.subList(0, propertyNamesUpdate.propertyCount - 1))); } - if (persistentProperty != null) { + if (propertyNamesUpdate.persistentProperty != null) { - if (persistentProperty.hasPropertyValueConverter()) { + if (propertyNamesUpdate.persistentProperty.hasPropertyValueConverter()) { PropertyValueConverter propertyValueConverter = Objects - .requireNonNull(persistentProperty.getPropertyValueConverter()); + .requireNonNull(propertyNamesUpdate.persistentProperty.getPropertyValueConverter()); criteria.getQueryCriteriaEntries().forEach(criteriaEntry -> { if (criteriaEntry.getKey().hasValue()) { @@ -1437,7 +1405,7 @@ private void updatePropertiesInCriteria(Criteria criteria, ElasticsearchPersiste }); } - org.springframework.data.elasticsearch.annotations.Field fieldAnnotation = persistentProperty + org.springframework.data.elasticsearch.annotations.Field fieldAnnotation = propertyNamesUpdate.persistentProperty .findAnnotation(org.springframework.data.elasticsearch.annotations.Field.class); if (fieldAnnotation != null) { @@ -1446,36 +1414,70 @@ private void updatePropertiesInCriteria(Criteria criteria, ElasticsearchPersiste } } + static record PropertyNamesUpdate( + String[] names, + Boolean nestedProperty, + Integer propertyCount, + ElasticsearchPersistentProperty persistentProperty) { + } + @Override public String updateFieldNames(String propertyPath, ElasticsearchPersistentEntity persistentEntity) { Assert.notNull(propertyPath, "propertyPath must not be null"); Assert.notNull(persistentEntity, "persistentEntity must not be null"); - var properties = propertyPath.split("\\.", 2); + var propertyNamesUpdate = updatePropertyNames(persistentEntity, propertyPath); + return String.join(".", propertyNamesUpdate.names()); + } - if (properties.length > 0) { - var propertyName = properties[0]; - var fieldName = propertyToFieldName(persistentEntity, propertyName); + /** + * Parse a propertyPath and replace the path values with the field names from a persistentEntity. path entries not + * found in the entity are kept as they are. + * + * @return the eventually modified names, a flag if a nested entity was encountered the number of processed + * propertiesand the last processed PersistentProperty. + */ + PropertyNamesUpdate updatePropertyNames(ElasticsearchPersistentEntity persistentEntity, String propertyPath) { - if (properties.length > 1) { - var persistentProperty = persistentEntity.getPersistentProperty(propertyName); + String[] propertyNames = propertyPath.split("\\."); + String[] fieldNames = Arrays.copyOf(propertyNames, propertyNames.length); - if (persistentProperty != null) { - ElasticsearchPersistentEntity nestedPersistentEntity = mappingContext - .getPersistentEntity(persistentProperty); - if (nestedPersistentEntity != null) { - return fieldName + '.' + updateFieldNames(properties[1], nestedPersistentEntity); - } else { - return fieldName; - } + ElasticsearchPersistentEntity currentEntity = persistentEntity; + ElasticsearchPersistentProperty persistentProperty = null; + + int propertyCount = 0; + boolean isNested = false; + + for (int i = 0; i < propertyNames.length; i++) { + persistentProperty = currentEntity.getPersistentProperty(propertyNames[i]); + + if (persistentProperty != null) { + propertyCount++; + fieldNames[i] = persistentProperty.getFieldName(); + + org.springframework.data.elasticsearch.annotations.Field fieldAnnotation = persistentProperty + .findAnnotation(org.springframework.data.elasticsearch.annotations.Field.class); + + if (fieldAnnotation != null && fieldAnnotation.type() == FieldType.Nested) { + isNested = true; + } + + try { + currentEntity = mappingContext.getPersistentEntity(persistentProperty.getActualType()); + } catch (Exception e) { + // using system types like UUIDs will lead to java.lang.reflect.InaccessibleObjectException in JDK 16 + // so if we cannot get an entity here, bail out. + currentEntity = null; } } - return fieldName; - } else { - return propertyPath; + + if (currentEntity == null) { + break; + } } + return new PropertyNamesUpdate(fieldNames, isNested, propertyCount, persistentProperty); } // endregion diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java index e73fe780c..0a5c963f5 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; +import static org.assertj.core.api.Assertions.*; import static org.skyscreamer.jsonassert.JSONAssert.*; import java.lang.reflect.Method; @@ -27,6 +28,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; +import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; @@ -679,6 +681,45 @@ void shouldBuildSortObjectWithCorrectFieldNames() throws NoSuchMethodException, assertEquals(expected, query, false); } + @Test // #3081 + @DisplayName("should build sort object with unknown field names") + void shouldBuildSortObjectWithUnknownFieldNames() throws NoSuchMethodException, JSONException { + + String methodName = "findByName"; + Class[] parameterClasses = new Class[] { String.class, Sort.class }; + Object[] parameters = new Object[] { BOOK_TITLE, Sort.by("sortAuthor.sortName.raw") }; + + String query = getQueryString(methodName, parameterClasses, parameters); + + String expected = """ + + { + "query": { + "bool": { + "must": [ + { + "query_string": { + "query": "Title", + "fields": [ + "name" + ] + } + } + ] + } + }, + "sort": [ + { + "sort_author.sort_name.raw": { + "order": "asc" + } + } + ] + }"""; + + assertEquals(expected, query, false); + } + private String getQueryString(String methodName, Class[] parameterClasses, Object[] parameters) throws NoSuchMethodException { @@ -768,6 +809,7 @@ private interface SampleRepository extends ElasticsearchRepository List findByNameOrderBySortAuthor_SortName(String name); + List findByName(String name, Sort sort); } public static class Book { From 95059b328228c6887f934aa4f1b2bf1e9b50fdb8 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Mon, 31 Mar 2025 16:36:42 +0200 Subject: [PATCH 088/131] Upgrade to Elasticsearch 8.17.4. Original Pull Request: #3085 Closes #3084 Signed-off-by: Peter-Josef Meisch --- pom.xml | 2 +- .../pages/elasticsearch/elasticsearch-new.adoc | 2 +- .../ROOT/pages/elasticsearch/versions.adoc | 2 +- .../client/elc/ResponseConverter.java | 2 -- .../core/query/ByQueryResponse.java | 17 ++--------------- .../core/reindex/ReindexResponse.java | 17 ++--------------- .../testcontainers-elasticsearch.properties | 2 +- 7 files changed, 8 insertions(+), 36 deletions(-) diff --git a/pom.xml b/pom.xml index 843be40fc..ef725516b 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.17.2 + 8.17.4 0.19.0 2.23.1 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 887dc49de..d8b9fc7e6 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.2. +* Upgrade to Elasticsearch 8.17.4. * 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 7851acaf4..8620ffc8b 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.2 | 6.2.x +| 2025.0 (in development) | 5.5.x | 8.17.4 | 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/ResponseConverter.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ResponseConverter.java index 3ae621a20..480c557c1 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 @@ -400,7 +400,6 @@ public ReindexResponse reindexResponse(co.elastic.clients.elasticsearch.core.Rei private ReindexResponse.Failure reindexResponseFailureOf(BulkIndexByScrollFailure failure) { return ReindexResponse.Failure.builder() // .withIndex(failure.index()) // - .withType(failure.type()) // .withId(failure.id()) // .withStatus(failure.status())// .withErrorCause(toErrorCause(failure.cause())) // @@ -411,7 +410,6 @@ private ReindexResponse.Failure reindexResponseFailureOf(BulkIndexByScrollFailur private ByQueryResponse.Failure byQueryResponseFailureOf(BulkIndexByScrollFailure failure) { return ByQueryResponse.Failure.builder() // .withIndex(failure.index()) // - .withType(failure.type()) // .withId(failure.id()) // .withStatus(failure.status())// .withErrorCause(toErrorCause(failure.cause())).build(); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java index 2cd40cd05..2f0236c85 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java @@ -167,7 +167,6 @@ public static ByQueryResponseBuilder builder() { public static class Failure { @Nullable private final String index; - @Nullable private final String type; @Nullable private final String id; @Nullable private final Exception cause; @Nullable private final Integer status; @@ -176,11 +175,10 @@ public static class Failure { @Nullable private final Boolean aborted; @Nullable private final ElasticsearchErrorCause elasticsearchErrorCause; - private Failure(@Nullable String index, @Nullable String type, @Nullable String id, @Nullable Exception cause, + private Failure(@Nullable String index, @Nullable String id, @Nullable Exception cause, @Nullable Integer status, @Nullable Long seqNo, @Nullable Long term, @Nullable Boolean aborted, @Nullable ElasticsearchErrorCause elasticsearchErrorCause) { this.index = index; - this.type = type; this.id = id; this.cause = cause; this.status = status; @@ -195,11 +193,6 @@ public String getIndex() { return index; } - @Nullable - public String getType() { - return type; - } - @Nullable public String getId() { return id; @@ -250,7 +243,6 @@ public static FailureBuilder builder() { */ public static final class FailureBuilder { @Nullable private String index; - @Nullable private String type; @Nullable private String id; @Nullable private Exception cause; @Nullable private Integer status; @@ -266,11 +258,6 @@ public FailureBuilder withIndex(String index) { return this; } - public FailureBuilder withType(String type) { - this.type = type; - return this; - } - public FailureBuilder withId(String id) { this.id = id; return this; @@ -307,7 +294,7 @@ public FailureBuilder withErrorCause(ElasticsearchErrorCause elasticsearchErrorC } public Failure build() { - return new Failure(index, type, id, cause, status, seqNo, term, aborted, elasticsearchErrorCause); + return new Failure(index, id, cause, status, seqNo, term, aborted, elasticsearchErrorCause); } } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java index dbb3e8cf4..345a109f7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java @@ -187,7 +187,6 @@ public static ReindexResponseBuilder builder() { public static class Failure { @Nullable private final String index; - @Nullable private final String type; @Nullable private final String id; @Nullable private final Exception cause; @Nullable private final Integer status; @@ -196,11 +195,10 @@ public static class Failure { @Nullable private final Boolean aborted; @Nullable private final ElasticsearchErrorCause elasticsearchErrorCause; - private Failure(@Nullable String index, @Nullable String type, @Nullable String id, @Nullable Exception cause, + private Failure(@Nullable String index, @Nullable String id, @Nullable Exception cause, @Nullable Integer status, @Nullable Long seqNo, @Nullable Long term, @Nullable Boolean aborted, @Nullable ElasticsearchErrorCause elasticsearchErrorCause) { this.index = index; - this.type = type; this.id = id; this.cause = cause; this.status = status; @@ -215,11 +213,6 @@ public String getIndex() { return index; } - @Nullable - public String getType() { - return type; - } - @Nullable public String getId() { return id; @@ -269,7 +262,6 @@ public static Failure.FailureBuilder builder() { */ public static final class FailureBuilder { @Nullable private String index; - @Nullable private String type; @Nullable private String id; @Nullable private Exception cause; @Nullable private Integer status; @@ -285,11 +277,6 @@ public Failure.FailureBuilder withIndex(String index) { return this; } - public Failure.FailureBuilder withType(String type) { - this.type = type; - return this; - } - public Failure.FailureBuilder withId(String id) { this.id = id; return this; @@ -326,7 +313,7 @@ public Failure.FailureBuilder withErrorCause(@Nullable ElasticsearchErrorCause e } public Failure build() { - return new Failure(index, type, id, cause, status, seqNo, term, aborted, elasticsearchErrorCause); + return new Failure(index, id, cause, status, seqNo, term, aborted, elasticsearchErrorCause); } } } diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 01b3d5e6f..7174db81c 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.2 +sde.testcontainers.image-version=8.17.4 # # # 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 From 0e5af905818ca852c377c0aa576e56516b713dac Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 5 Apr 2025 20:44:01 +0200 Subject: [PATCH 089/131] Fix implementation of equlas/hashcode for Criteria class. Original Pull Request: #3088 Closes: #3083 Signed-off-by: Peter-Josef Meisch --- .../elasticsearch/core/query/Criteria.java | 21 +++- .../elc/CriteriaQueryMappingUnitTests.java | 104 ++++++++++++++++++ 2 files changed, 124 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java index 03d7e1ef9..d398d7ee1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.core.geo.GeoBox; @@ -859,6 +860,7 @@ private List toCollection(Object... values) { // endregion + // region equals/hashcode @Override public boolean equals(Object o) { if (this == o) @@ -874,6 +876,8 @@ public boolean equals(Object o) { return false; if (!Objects.equals(field, criteria.field)) return false; + if (!criteriaChain.filter(this).equals(criteria.criteriaChain.filter(criteria))) + return false; if (!queryCriteriaEntries.equals(criteria.queryCriteriaEntries)) return false; if (!filterCriteriaEntries.equals(criteria.filterCriteriaEntries)) @@ -886,11 +890,16 @@ public int hashCode() { int result = field != null ? field.hashCode() : 0; result = 31 * result + (boost != +0.0f ? Float.floatToIntBits(boost) : 0); result = 31 * result + (negating ? 1 : 0); + // the criteriaChain contains "this" object, so we need to filter it out + // to avoid a stackoverflow here, because the hashcode implementation + // uses the element's hashcodes + result = 31 * result + criteriaChain.filter(this).hashCode(); result = 31 * result + queryCriteriaEntries.hashCode(); result = 31 * result + filterCriteriaEntries.hashCode(); result = 31 * result + subCriteria.hashCode(); return result; } + // endregion @Override public String toString() { @@ -938,7 +947,17 @@ public Operator getOperator() { * * @since 4.1 */ - public static class CriteriaChain extends LinkedList {} + public static class CriteriaChain extends LinkedList { + /** + * return a copy of this list with the given element filtered out. + * + * @param criteria the element to filter + * @return the filtered list + */ + List filter(Criteria criteria) { + return this.stream().filter(c -> c != criteria).collect(Collectors.toList()); + } + } /** * Operator to join the entries of the criteria chain diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java index 88f984614..e53a33df6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.client.elc; +import static org.assertj.core.api.Assertions.*; import static org.skyscreamer.jsonassert.JSONAssert.*; import static org.springframework.data.elasticsearch.client.elc.JsonUtils.*; @@ -22,6 +23,7 @@ import co.elastic.clients.json.jackson.JacksonJsonpMapper; import java.time.LocalDate; +import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; @@ -445,6 +447,108 @@ void shouldMapNamesInSourceStoredFields() { softly.assertAll(); } + // the following test failed because of a wrong implementation in Criteria + // equals and hscode methods. + @Test // #3083 + @DisplayName("should map correct subcriteria") + void shouldMapCorrectSubcriteria() throws JSONException { + Criteria criteria = new Criteria("first").is("hello"); + + List criterias = new ArrayList<>(); + criterias.add(new Criteria().or("second").exists()); + + List subCriterias = new ArrayList<>(); + subCriterias.add(new Criteria("third").exists() + .and(new Criteria("fourth").is("ciao"))); + subCriterias.add(new Criteria("third").exists() + .and(new Criteria("fourth").is("hi"))); + + Criteria result = Criteria.or(); + + for (Criteria c : criterias) { + result = result.or(c); + } + + for (Criteria c : subCriterias) { + result = result.subCriteria(c); + } + criteria = criteria.subCriteria(result); + CriteriaQuery criteriaQuery = new CriteriaQuery(criteria); + + String expected = """ + { + "bool": { + "must": [ + { + "query_string": { + "default_operator": "and", + "fields": [ + "first" + ], + "query": "hello" + } + }, + { + "bool": { + "should": [ + { + "exists": { + "field": "second" + } + }, + { + "bool": { + "must": [ + { + "exists": { + "field": "third" + } + }, + { + "query_string": { + "default_operator": "and", + "fields": [ + "fourth" + ], + "query": "ciao" + } + } + ] + } + }, + { + "bool": { + "must": [ + { + "exists": { + "field": "third" + } + }, + { + "query_string": { + "default_operator": "and", + "fields": [ + "fourth" + ], + "query": "hi" + } + } + ] + } + } + ] + } + } + ] + } + } + """; + + mappingElasticsearchConverter.updateQuery(criteriaQuery, Person.class); + var queryString = queryToJson(CriteriaQueryProcessor.createQuery(criteriaQuery.getCriteria()), mapper); + + assertEquals(expected, queryString, false); + } // endregion // region helper functions From 9ffcb092dbf6d1291c6836a1ee5a9907dd627c5a Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 11:23:52 +0200 Subject: [PATCH 090/131] Prepare 5.5 RC1 (2025.0.0). See #3079 --- pom.xml | 14 ++------------ src/main/resources/notice.txt | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index ef725516b..3f7874685 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-SNAPSHOT + 3.5.0-RC1 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-SNAPSHOT + 3.5.0-RC1 8.17.4 @@ -450,16 +450,6 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - spring-milestone https://repo.spring.io/milestone diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 81abb2cfe..16ca5fb4b 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.5 M2 (2025.0.0) +Spring Data Elasticsearch 5.5 RC1 (2025.0.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -27,3 +27,4 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 2f0a2590459956266867f8223de74eddd55abdb3 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 11:24:11 +0200 Subject: [PATCH 091/131] Release version 5.5 RC1 (2025.0.0). See #3079 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3f7874685..6d3bb524d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-SNAPSHOT + 5.5.0-RC1 org.springframework.data.build From 925921f17470fc8211e33274226f89eec4d59dc7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 11:26:48 +0200 Subject: [PATCH 092/131] Prepare next development iteration. See #3079 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6d3bb524d..3f7874685 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-RC1 + 5.5.0-SNAPSHOT org.springframework.data.build From 9d025dd4693271b6741128499074e56dad7508e2 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 11:26:49 +0200 Subject: [PATCH 093/131] After release cleanups. See #3079 --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3f7874685..ef725516b 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-RC1 + 3.5.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-RC1 + 3.5.0-SNAPSHOT 8.17.4 @@ -450,6 +450,16 @@ + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + spring-milestone https://repo.spring.io/milestone From a07ac3c93d6cf05b4713620877c4d45958b7d514 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 26 Apr 2025 10:40:31 +0200 Subject: [PATCH 094/131] Fix code not terminating on repository saving an empty flux. Original Pull Request #3099 Closes: #3039 Signed-off-by: Peter-Josef Meisch --- ...AbstractReactiveElasticsearchTemplate.java | 6 ++++++ ...asticsearchRepositoryIntegrationTests.java | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java index 3fee5f2db..a2449b2a7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java @@ -233,6 +233,7 @@ public Flux save(Flux entities, IndexCoordinates index, int bulkSize) .subscribe(new Subscriber<>() { @Nullable private Subscription subscription = null; private final AtomicBoolean upstreamComplete = new AtomicBoolean(false); + private final AtomicBoolean onNextHasBeenCalled = new AtomicBoolean(false); @Override public void onSubscribe(Subscription subscription) { @@ -242,6 +243,7 @@ public void onSubscribe(Subscription subscription) { @Override public void onNext(List entityList) { + onNextHasBeenCalled.set(true); saveAll(entityList, index) .map(sink::tryEmitNext) .doOnComplete(() -> { @@ -267,6 +269,10 @@ public void onError(Throwable throwable) { @Override public void onComplete() { upstreamComplete.set(true); + if (!onNextHasBeenCalled.get()) { + // this happens when an empty flux is saved + sink.tryEmitComplete(); + } } }); return sink.asFlux(); diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java index c7b77e584..17fddb928 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java @@ -105,6 +105,26 @@ private Mono documentWithIdExistsInIndex(String id) { return operations.exists(id, IndexCoordinates.of(indexNameProvider.indexName())); } + @Test // #3093 + @DisplayName("should save all from empty collection") + void shouldSaveAllFromEmptyCollection() { + + repository.saveAll(Collections.emptyList()) + .as(StepVerifier::create) + .expectNextCount(0) + .verifyComplete(); + } + + @Test // #3093 + @DisplayName("should save all from empty flux") + void shouldSaveAllFromEmptyFlux() { + + repository.saveAll(Flux.empty()) + .as(StepVerifier::create) + .expectNextCount(0) + .verifyComplete(); + } + @Test // DATAES-519 void saveShouldComputeMultipleEntities() { From 5a0f556a3bcb9f181f6de80f77316d6b9cc08ca1 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 2 May 2025 10:21:24 +0200 Subject: [PATCH 095/131] Upgrade Elasticsearch dependencies to 8.18.0 Original Pull request #3101 Adjust to changes in Elasticsearch. Closes #3100 Signed-off-by: Peter-Josef Meisch --- pom.xml | 8 ++++++- .../elasticsearch/elasticsearch-new.adoc | 2 +- .../ROOT/pages/elasticsearch/versions.adoc | 2 +- .../client/elc/RequestConverter.java | 24 ++++++++++++++----- .../client/elc/ResponseConverter.java | 2 +- .../testcontainers-elasticsearch.properties | 2 +- 6 files changed, 29 insertions(+), 11 deletions(-) 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 From acbfba94ac4c4d7bde0de9c36b2296de3aef96f5 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 9 May 2025 12:10:07 +0200 Subject: [PATCH 096/131] Exclude `commons-logging` dependency. `elasticsearch-rest-client` pulls in `commons-logging` and we don't want that to happen as it conflicts with our dependency setup. Closes #3104 --- pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 329a83ee7..ae6787308 100644 --- a/pom.xml +++ b/pom.xml @@ -131,13 +131,19 @@ + org.elasticsearch.client elasticsearch-rest-client ${elasticsearch-java} + + + commons-logging + commons-logging + + - com.fasterxml.jackson.core From ea38ef1d413b37fe05ff2a8dacad2012bc46f7e0 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Fri, 9 May 2025 20:35:30 +0200 Subject: [PATCH 097/131] Upgrade Elasticsearch libraries to 8.18.1. Original Pull Request #3105 Closes #3103 Signed-off-by: Peter-Josef Meisch --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 2 +- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ae6787308..796c49369 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 3.5.0-SNAPSHOT - 8.18.0 + 8.18.1 0.19.0 2.23.1 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 46b4b522c..5dca4fab6 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.18.0. +* Upgrade to Elasticsearch 8.18.1. * 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 bde67f92b..921d96e46 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.18.0 | 6.2.x +| 2025.0 (in development) | 5.5.x | 8.18.1 | 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/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index d4a87a436..6860b4150 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.18.0 +sde.testcontainers.image-version=8.18.1 # # # 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 From 945179e4eb6322ed8d2c77c7ce1188cbe0edcdb6 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 10 May 2025 21:21:17 +0200 Subject: [PATCH 098/131] Fix handling of page size and max results in search request preparation. Original Pull Request #3106 Closes #3089 Signed-off-by: Peter-Josef Meisch --- .../client/elc/RequestConverter.java | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) 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 ef0700b8b..658b2caee 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 @@ -1295,11 +1295,15 @@ public MsearchRequest searchMsearchRequest( .timeout(timeStringMs(query.getTimeout())) // ; - if (query.getPageable().isPaged()) { - bb // - .from((int) query.getPageable().getOffset()) // - .size(query.getPageable().getPageSize()); - } + var offset = query.getPageable().isPaged() ? query.getPageable().getOffset() : 0; + var pageSize = query.getPageable().isPaged() ? query.getPageable().getPageSize() + : INDEX_MAX_RESULT_WINDOW; + // if we have both a page size and a max results, we take the min, this is necessary for + // searchForStream to work correctly (#3098) as there the page size defines what is + // returned in a single request, and the max result determines the total number of + // documents returned + var size = query.isLimiting() ? Math.min(pageSize, query.getMaxResults()) : pageSize; + bb.from((int) offset).size(size); if (!isEmpty(query.getFields())) { bb.fields(fb -> { @@ -1312,10 +1316,6 @@ public MsearchRequest searchMsearchRequest( bb.storedFields(query.getStoredFields()); } - if (query.isLimiting()) { - bb.size(query.getMaxResults()); - } - if (query.getMinScore() > 0) { bb.minScore((double) query.getMinScore()); } @@ -1473,13 +1473,14 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu builder.seqNoPrimaryTerm(true); } - if (query.getPageable().isPaged()) { - builder // - .from((int) query.getPageable().getOffset()) // - .size(query.getPageable().getPageSize()); - } else { - builder.from(0).size(INDEX_MAX_RESULT_WINDOW); - } + var offset = query.getPageable().isPaged() ? query.getPageable().getOffset() : 0; + var pageSize = query.getPageable().isPaged() ? query.getPageable().getPageSize() : INDEX_MAX_RESULT_WINDOW; + // if we have both a page size and a max results, we take the min, this is necessary for + // searchForStream to work correctly (#3098) as there the page size defines what is + // returned in a single request, and the max result determines the total number of + // documents returned + var size = query.isLimiting() ? Math.min(pageSize, query.getMaxResults()) : pageSize; + builder.from((int) offset).size(size); if (!isEmpty(query.getFields())) { var fieldAndFormats = query.getFields().stream().map(field -> FieldAndFormat.of(b -> b.field(field))).toList(); @@ -1494,10 +1495,6 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu addIndicesOptions(builder, query.getIndicesOptions()); } - if (query.isLimiting()) { - builder.size(query.getMaxResults()); - } - if (query.getMinScore() > 0) { builder.minScore((double) query.getMinScore()); } From 8c9d9ae1e7f90924620871aebbbd311fc7e9c710 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 08:55:54 +0200 Subject: [PATCH 099/131] Update CI Properties. See #3096 --- .mvn/jvm.config | 4 ++++ ci/pipeline.properties | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.mvn/jvm.config b/.mvn/jvm.config index 32599cefe..e27f6e8f5 100644 --- a/.mvn/jvm.config +++ b/.mvn/jvm.config @@ -8,3 +8,7 @@ --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED +--add-opens=java.base/java.util=ALL-UNNAMED +--add-opens=java.base/java.lang.reflect=ALL-UNNAMED +--add-opens=java.base/java.text=ALL-UNNAMED +--add-opens=java.desktop/java.awt.font=ALL-UNNAMED diff --git a/ci/pipeline.properties b/ci/pipeline.properties index cd2fcf7fb..9eb163fde 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -7,8 +7,6 @@ docker.java.main.image=library/eclipse-temurin:${java.main.tag} docker.java.next.image=library/eclipse-temurin:${java.next.tag} # Supported versions of MongoDB -docker.mongodb.4.4.version=4.4.25 -docker.mongodb.5.0.version=5.0.21 docker.mongodb.6.0.version=6.0.10 docker.mongodb.7.0.version=7.0.2 docker.mongodb.8.0.version=8.0.0 @@ -17,9 +15,6 @@ docker.mongodb.8.0.version=8.0.0 docker.redis.6.version=6.2.13 docker.redis.7.version=7.2.4 -# Supported versions of Cassandra -docker.cassandra.3.version=3.11.16 - # 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 From 9870de1e774267b5719a2372998d2763f41ce401 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 08:56:22 +0200 Subject: [PATCH 100/131] Update CI Properties. See #3096 --- ci/pipeline.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 9eb163fde..34eef52b6 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -1,15 +1,15 @@ # Java versions java.main.tag=17.0.13_11-jdk-focal -java.next.tag=23.0.1_11-jdk-noble +java.next.tag=24.0.1_9-jdk-noble # Docker container images - standard docker.java.main.image=library/eclipse-temurin:${java.main.tag} docker.java.next.image=library/eclipse-temurin:${java.next.tag} # Supported versions of MongoDB -docker.mongodb.6.0.version=6.0.10 -docker.mongodb.7.0.version=7.0.2 -docker.mongodb.8.0.version=8.0.0 +docker.mongodb.6.0.version=6.0.23 +docker.mongodb.7.0.version=7.0.20 +docker.mongodb.8.0.version=8.0.9 # Supported versions of Redis docker.redis.6.version=6.2.13 From 22763d17a7a4728eb4cc0115a22aa8c154c1709f Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 09:00:23 +0200 Subject: [PATCH 101/131] Update CI Properties. See #3096 --- ci/pipeline.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 34eef52b6..cb3670dee 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -1,5 +1,5 @@ # Java versions -java.main.tag=17.0.13_11-jdk-focal +java.main.tag=17.0.15_6-jdk-focal java.next.tag=24.0.1_9-jdk-noble # Docker container images - standard From 0ce9a1c400fd1f3d26b88957e52647cb39948db2 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 09:33:06 +0200 Subject: [PATCH 102/131] Update CI Properties. See #3096 --- ci/pipeline.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index cb3670dee..8dd2295ac 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -14,6 +14,7 @@ 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.valkey.8.version=8.1.1 # Docker environment settings docker.java.inside.basic=-v $HOME:/tmp/jenkins-home From ebbe242a7228d7f573b8a25f0565060e2c0fa528 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Wed, 14 May 2025 13:53:58 +0200 Subject: [PATCH 103/131] Fix missing return value in ByQueryResponse. Original Pull Request #3109 Closes #3108 Signed-off-by: Peter-Josef Meisch --- .../data/elasticsearch/client/elc/ResponseConverter.java | 4 ++++ .../elasticsearch/core/ElasticsearchIntegrationTests.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 ce7211970..ad6a44d58 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 @@ -498,6 +498,10 @@ public ByQueryResponse byQueryResponse(UpdateByQueryResponse response) { builder.withDeleted(response.deleted()); } + if(response.updated() != null) { + builder.withUpdated(response.updated()); + } + if (response.batches() != null) { builder.withBatches(Math.toIntExact(response.batches())); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java index bac9a9b71..98449b4cc 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java @@ -1636,7 +1636,9 @@ void shouldDoUpdateByQueryForExistingDocument() { .withParams(Collections.singletonMap("newMessage", messageAfterUpdate)).withAbortOnVersionConflict(true) .build(); - operations.updateByQuery(updateQuery, IndexCoordinates.of(indexNameProvider.indexName())); + var byQueryResponse = operations.updateByQuery(updateQuery, IndexCoordinates.of(indexNameProvider.indexName())); + + assertThat(byQueryResponse.getUpdated()).isEqualTo(1); SampleEntity indexedEntity = operations.get(documentId, SampleEntity.class, IndexCoordinates.of(indexNameProvider.indexName())); From 0728c8e4aa18a067a83f1bc3717f4769f6038c16 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 15 May 2025 17:39:17 +0200 Subject: [PATCH 104/131] Update versions doc for the next release Signed-off-by: Peter-Josef Meisch --- .../antora/modules/ROOT/pages/elasticsearch/versions.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 921d96e46..72ad88a0e 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,10 +6,10 @@ 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.18.1 | 6.2.x +| 2025.0 | 5.5.x | 8.18.1 | 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 +| 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x +| 2023.1 (Vaughan) | 5.2.xfootnote:oom[] | 8.11.1 | 6.1.x | 2023.0 (Ullmann) | 5.1.xfootnote:oom[] | 8.7.1 | 6.0.x | 2022.0 (Turing) | 5.0.xfootnote:oom[] | 8.5.3 | 6.0.x | 2021.2 (Raj) | 4.4.xfootnote:oom[] | 7.17.3 | 5.3.x From cc5f149c5a5f210bea37e7dce5380a1faf5a5721 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 11:28:10 +0200 Subject: [PATCH 105/131] Prepare 5.5 GA (2025.0.0). See #3096 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 796c49369..c4bda19d5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 3.5.0-SNAPSHOT + 3.5.0 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0-SNAPSHOT + 3.5.0 8.18.1 @@ -462,20 +462,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 16ca5fb4b..7f6d7c582 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.5 RC1 (2025.0.0) +Spring Data Elasticsearch 5.5 GA (2025.0.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -27,4 +27,5 @@ conditions of the subcomponent's license, as noted in the LICENSE file. + From 62a34cf09c1a6c70764500f8bcb3ebe526730d31 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 11:28:31 +0200 Subject: [PATCH 106/131] Release version 5.5 GA (2025.0.0). See #3096 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4bda19d5..51f60ff7b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0-SNAPSHOT + 5.5.0 org.springframework.data.build From 08a1ef3a2857d816e34f801df176e861a583f724 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 11:31:15 +0200 Subject: [PATCH 107/131] Prepare next development iteration. See #3096 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 51f60ff7b..aa0a10c36 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 5.5.0 + 5.6.0-SNAPSHOT org.springframework.data.build From df6a127629aca8cb1a25fbc0af9d22f89e834727 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 11:31:17 +0200 Subject: [PATCH 108/131] After release cleanups. See #3096 --- pom.xml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index aa0a10c36..924646d62 100644 --- a/pom.xml +++ b/pom.xml @@ -5,12 +5,12 @@ org.springframework.data spring-data-elasticsearch - 5.6.0-SNAPSHOT + 6.0.0-SNAPSHOT org.springframework.data.build spring-data-parent - 3.5.0 + 4.0.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 3.5.0 + 4.0.0-SNAPSHOT 8.18.1 @@ -462,8 +462,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From 49d5dee5aa9038c054de74660eb98373ea588dad Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 24 Nov 2024 11:08:40 +0100 Subject: [PATCH 109/131] Update versions documentation Signed-off-by: Peter-Josef Meisch --- src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 72ad88a0e..b626405a8 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,7 +6,8 @@ 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 | 5.5.x | 8.18.1 | 6.2.x +| 2025.1 (in development) | 6.0.x | 8.17.2 | 6.2.x +| 2025.0 | 5.5.x | 8.17.2 | 6.2.x | 2024.1 | 5.4.x | 8.15.5 | 6.1.x | 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.xfootnote:oom[] | 8.11.1 | 6.1.x From e298bc9f7a7f9d9b6f79617ca583b38e7802e521 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 8 Jan 2025 15:11:09 +0100 Subject: [PATCH 110/131] Adopt to changes in Spring Framework 7. See #3038 --- .../data/elasticsearch/support/HttpHeadersTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java b/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java index e9a0a0452..c72fb1b3f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/support/HttpHeadersTest.java @@ -78,7 +78,8 @@ void shouldInitializeFromSpringHttpHeaders() { springHttpHeaders.add(headerName, "true"); var httpHeaders = new HttpHeaders(); - httpHeaders.addAll(springHttpHeaders); + + springHttpHeaders.forEach(httpHeaders::addAll); assertThat(httpHeaders.get(X_TEST_HEADER)).containsExactly("foo", "bar"); assertThat(httpHeaders.get(headerName)).containsExactly("true"); From 76fe240a243411cdd97a5bb7589f7fc9fd9d27c3 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Fri, 24 Jan 2025 10:48:00 +0100 Subject: [PATCH 111/131] Prepare 6.0 M1 (2025.1.0). See #3006 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 23 +---------------------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/pom.xml b/pom.xml index 924646d62..0ae6342c5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-SNAPSHOT + 4.0.0-M1 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-SNAPSHOT + 4.0.0-M1 8.18.1 @@ -462,20 +462,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 7f6d7c582..c9ad4c05b 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 5.5 GA (2025.0.0) +Spring Data Elasticsearch 6.0 M1 (2025.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -8,24 +8,3 @@ This product may include a number of subcomponents with separate copyright notices and license terms. Your use of the source code for the these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. - - - - - - - - - - - - - - - - - - - - - From 1acd392af7f397fa305d7a8d65ad31b0a10d648e Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Fri, 24 Jan 2025 10:48:55 +0100 Subject: [PATCH 112/131] Release version 6.0 M1 (2025.1.0). See #3006 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ae6342c5..7edfc4638 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-SNAPSHOT + 6.0.0-M1 org.springframework.data.build From 710526c5f632a7e2b1e1967d319e386d6e042341 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Fri, 24 Jan 2025 10:53:10 +0100 Subject: [PATCH 113/131] Prepare next development iteration. See #3006 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7edfc4638..0ae6342c5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-M1 + 6.0.0-SNAPSHOT org.springframework.data.build From 09984f86e6a944e517eeb4810f2c8076f8be14c4 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Fri, 24 Jan 2025 10:53:12 +0100 Subject: [PATCH 114/131] After release cleanups. See #3006 --- pom.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0ae6342c5..924646d62 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-M1 + 4.0.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-M1 + 4.0.0-SNAPSHOT 8.18.1 @@ -462,8 +462,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From 3a4425053e0b523276e2f2c58804932cea0535bc Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Mon, 10 Feb 2025 12:00:32 +0100 Subject: [PATCH 115/131] Cleanup unneeded imports after deprecation removal Signed-off-by: Peter-Josef Meisch --- .../query/AbstractReactiveElasticsearchRepositoryQuery.java | 1 - .../elasticsearch/repository/query/ElasticsearchQueryMethod.java | 1 - .../repository/query/ReactiveRepositoryStringQuery.java | 1 - .../elasticsearch/repository/support/QueryStringProcessor.java | 1 - .../repository/query/ReactiveRepositoryStringQueryUnitTests.java | 1 - 5 files changed, 5 deletions(-) diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java index 6bd79fb90..7b149141e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java @@ -36,7 +36,6 @@ import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.ParameterAccessor; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ResultProcessor; import org.springframework.util.Assert; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index 5433a3bd6..e6d995846 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -51,7 +51,6 @@ import org.springframework.data.repository.query.Parameters; import org.springframework.data.repository.query.ParametersSource; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.util.QueryExecutionConverters; import org.springframework.data.repository.util.ReactiveWrapperConverters; import org.springframework.data.util.TypeInformation; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java index 11e3b81ec..45b9e66e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQuery.java @@ -20,7 +20,6 @@ import org.springframework.data.elasticsearch.core.query.BaseQuery; import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repository.support.QueryStringProcessor; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.data.repository.query.ValueExpressionDelegate; import org.springframework.util.Assert; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java index b8cfa930b..a32b503b0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java @@ -20,7 +20,6 @@ import org.springframework.data.elasticsearch.repository.support.spel.QueryStringSpELEvaluator; import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.repository.query.QueryMethod; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.util.Assert; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java index 536dde273..345f9816e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java @@ -49,7 +49,6 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; import org.springframework.data.repository.Repository; -import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider; import org.springframework.lang.Nullable; /** From e9c7c0ee95a989bbd1b63bf96461aee1f3c2ebca Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sun, 23 Feb 2025 16:19:05 +0100 Subject: [PATCH 116/131] Switch to jspecify nullability annotations. Original Pull Request #3065 Closes #2984 Signed-off-by: Peter-Josef Meisch --- .../ROOT/pages/elasticsearch/auditing.adoc | 6 +- .../scripted-and-runtime-fields.adoc | 2 +- .../ElasticsearchErrorCause.java | 7 +- .../UncategorizedElasticsearchException.java | 2 +- .../annotations/package-info.java | 3 +- .../SpringDataElasticsearchRuntimeHints.java | 2 +- .../data/elasticsearch/aot/package-info.java | 3 +- .../client/ClientConfiguration.java | 2 +- .../client/ClientConfigurationBuilder.java | 2 +- .../client/DefaultClientConfiguration.java | 3 +- .../client/elc/AbstractQueryProcessor.java | 6 +- .../client/elc/CriteriaQueryProcessor.java | 2 +- .../client/elc/DocumentAdapters.java | 4 +- .../client/elc/ElasticsearchAggregations.java | 2 +- .../elc/ElasticsearchClientFactoryBean.java | 2 +- .../client/elc/ElasticsearchClients.java | 2 +- .../client/elc/ElasticsearchTemplate.java | 2 +- .../client/elc/HighlightQueryBuilder.java | 5 +- .../client/elc/IndicesTemplate.java | 2 +- .../elasticsearch/client/elc/JsonUtils.java | 4 +- .../elasticsearch/client/elc/NativeQuery.java | 9 +- .../client/elc/NativeQueryBuilder.java | 7 +- .../elasticsearch/client/elc/Queries.java | 2 +- .../elc/ReactiveElasticsearchClient.java | 2 +- .../ReactiveElasticsearchClusterClient.java | 12 +- .../ReactiveElasticsearchIndicesClient.java | 2 +- .../elc/ReactiveElasticsearchTemplate.java | 2 +- .../client/elc/ReactiveIndicesTemplate.java | 2 +- .../client/elc/RequestConverter.java | 10 +- .../client/elc/ResponseConverter.java | 5 +- .../elc/SearchDocumentResponseBuilder.java | 8 +- .../elasticsearch/client/elc/TypeUtils.java | 17 +- .../aot/ElasticsearchClientRuntimeHints.java | 4 +- .../client/elc/aot/package-info.java | 3 +- .../client/elc/package-info.java | 3 +- .../elasticsearch/client/package-info.java | 3 +- .../client/util/ScrollState.java | 2 +- .../client/util/package-info.java | 3 +- ...ticsearchAuditingBeanDefinitionParser.java | 2 +- .../ElasticsearchConfigurationSupport.java | 2 +- .../elasticsearch/config/package-info.java | 3 +- .../core/AbstractElasticsearchTemplate.java | 2 +- ...AbstractReactiveElasticsearchTemplate.java | 2 +- .../core/DocumentOperations.java | 2 +- .../core/ElasticsearchOperations.java | 2 +- .../elasticsearch/core/EntityOperations.java | 4 +- .../elasticsearch/core/IndexInformation.java | 2 +- .../elasticsearch/core/IndexOperations.java | 2 +- .../core/IndexOperationsAdapter.java | 2 +- .../core/IndexedObjectInformation.java | 2 +- .../data/elasticsearch/core/MultiGetItem.java | 2 +- .../core/ReactiveElasticsearchOperations.java | 2 +- .../core/ReactiveSearchHits.java | 2 +- .../core/ReactiveSearchHitsImpl.java | 2 +- .../data/elasticsearch/core/SearchHit.java | 2 +- .../elasticsearch/core/SearchHitMapping.java | 2 +- .../elasticsearch/core/SearchHitSupport.java | 2 +- .../data/elasticsearch/core/SearchHits.java | 2 +- .../elasticsearch/core/SearchHitsImpl.java | 2 +- .../core/SearchHitsIterator.java | 2 +- .../elasticsearch/core/SearchOperations.java | 5 +- .../elasticsearch/core/SearchScrollHits.java | 2 +- .../core/SearchShardStatistics.java | 2 +- .../elasticsearch/core/StreamQueries.java | 2 +- .../core/cluster/package-info.java | 3 +- .../DefaultElasticsearchTypeMapper.java | 2 +- .../core/convert/ElasticsearchConverter.java | 2 +- .../core/convert/ElasticsearchTypeMapper.java | 2 +- .../convert/MappingConversionException.java | 2 +- .../MappingElasticsearchConverter.java | 2 +- .../core/convert/package-info.java | 3 +- .../elasticsearch/core/document/Document.java | 2 +- .../core/document/Explanation.java | 2 +- .../core/document/MapDocument.java | 3 +- .../core/document/NestedMetaData.java | 2 +- .../core/document/SearchDocument.java | 2 +- .../core/document/SearchDocumentAdapter.java | 2 +- .../core/document/SearchDocumentResponse.java | 2 +- .../core/document/package-info.java | 3 +- .../core/event/package-info.java | 3 +- .../elasticsearch/core/geo/package-info.java | 3 +- .../core/index/AliasActionParameters.java | 2 +- .../core/index/AliasActions.java | 2 +- .../elasticsearch/core/index/AliasData.java | 2 +- .../index/ComponentTemplateRequestData.java | 2 +- .../core/index/GeoShapeMappingParameters.java | 2 +- .../core/index/MappingBuilder.java | 9 +- .../core/index/MappingParameters.java | 2 +- .../index/PutComponentTemplateRequest.java | 3 +- .../core/index/PutIndexTemplateRequest.java | 2 +- .../core/index/PutTemplateRequest.java | 6 +- .../core/index/ReactiveMappingBuilder.java | 2 +- .../core/index/TemplateData.java | 2 +- .../core/index/TemplateResponse.java | 3 +- .../core/index/TemplateResponseData.java | 2 +- .../core/index/package-info.java | 3 +- .../elasticsearch/core/join/JoinField.java | 2 +- .../elasticsearch/core/mapping/Alias.java | 2 +- .../core/mapping/CreateIndexSettings.java | 2 +- .../ElasticsearchPersistentEntity.java | 5 +- .../ElasticsearchPersistentProperty.java | 2 +- .../SimpleElasticsearchMappingContext.java | 2 +- .../SimpleElasticsearchPersistentEntity.java | 13 +- ...SimpleElasticsearchPersistentProperty.java | 2 +- .../core/mapping/package-info.java | 3 +- .../data/elasticsearch/core/package-info.java | 3 +- .../elasticsearch/core/query/BaseQuery.java | 2 +- .../core/query/BaseQueryBuilder.java | 17 +- .../elasticsearch/core/query/BulkOptions.java | 2 +- .../core/query/ByQueryResponse.java | 2 +- .../elasticsearch/core/query/Criteria.java | 2 +- .../elasticsearch/core/query/DeleteQuery.java | 2 +- .../core/query/DocValueField.java | 2 +- .../core/query/FetchSourceFilter.java | 2 +- .../core/query/FetchSourceFilterBuilder.java | 2 +- .../data/elasticsearch/core/query/Field.java | 2 +- .../core/query/HasChildQuery.java | 2 +- .../core/query/HasParentQuery.java | 2 +- .../core/query/HighlightQuery.java | 2 +- .../elasticsearch/core/query/IndexQuery.java | 2 +- .../core/query/IndexQueryBuilder.java | 4 +- .../core/query/InnerHitsQuery.java | 2 +- .../core/query/MoreLikeThisQuery.java | 2 +- .../data/elasticsearch/core/query/Order.java | 2 +- .../data/elasticsearch/core/query/Query.java | 2 +- .../core/query/RescorerQuery.java | 2 +- .../core/query/RuntimeField.java | 2 +- .../elasticsearch/core/query/ScriptData.java | 2 +- .../core/query/SearchTemplateQuery.java | 2 +- .../query/SearchTemplateQueryBuilder.java | 2 +- .../elasticsearch/core/query/SimpleField.java | 15 +- .../core/query/SourceFilter.java | 2 +- .../elasticsearch/core/query/SqlQuery.java | 2 +- .../elasticsearch/core/query/UpdateQuery.java | 2 +- .../highlight/HighlightCommonParameters.java | 2 +- .../core/query/highlight/package-info.java | 3 +- .../core/query/package-info.java | 3 +- .../core/query/types/package-info.java | 3 +- .../core/reindex/ReindexRequest.java | 12 +- .../core/reindex/ReindexResponse.java | 2 +- .../elasticsearch/core/reindex/Remote.java | 2 +- .../core/reindex/package-info.java | 3 +- .../core/routing/DefaultRoutingResolver.java | 2 +- .../core/routing/RoutingResolver.java | 2 +- .../core/routing/package-info.java | 3 +- .../elasticsearch/core/script/Script.java | 3 +- .../core/script/ScriptOperations.java | 2 +- .../core/script/package-info.java | 6 +- .../elasticsearch/core/sql/SqlResponse.java | 4 +- .../elasticsearch/core/sql/package-info.java | 3 +- .../core/suggest/Completion.java | 2 +- .../core/suggest/package-info.java | 3 +- .../response/CompletionSuggestion.java | 2 +- .../suggest/response/PhraseSuggestion.java | 4 +- .../core/suggest/response/Suggest.java | 2 +- .../core/suggest/response/TermSuggestion.java | 2 +- .../core/suggest/response/package-info.java | 3 +- .../data/elasticsearch/package-info.java | 3 +- .../repository/ElasticsearchRepository.java | 2 +- .../ReactiveElasticsearchRepository.java | 2 +- .../aot/RepositoryRuntimeHints.java | 2 +- .../repository/aot/package-info.java | 3 +- .../repository/cdi/package-info.java | 3 +- .../repository/config/package-info.java | 3 +- .../repository/package-info.java | 2 +- .../AbstractElasticsearchRepositoryQuery.java | 2 +- ...tReactiveElasticsearchRepositoryQuery.java | 7 +- .../query/ElasticsearchQueryMethod.java | 6 +- .../ReactiveElasticsearchQueryExecution.java | 2 +- .../repository/query/package-info.java | 3 +- .../parser/ElasticsearchQueryCreator.java | 318 +++++++++--------- .../repository/query/parser/package-info.java | 3 +- .../ElasticsearchEntityInformation.java | 5 +- .../ElasticsearchRepositoryFactory.java | 2 +- .../ElasticsearchRepositoryFactoryBean.java | 2 +- .../support/QueryStringProcessor.java | 2 +- ...eactiveElasticsearchRepositoryFactory.java | 2 +- ...iveElasticsearchRepositoryFactoryBean.java | 2 +- .../SimpleElasticsearchRepository.java | 4 +- ...SimpleReactiveElasticsearchRepository.java | 2 +- .../repository/support/package-info.java | 3 +- .../querybyexample/ExampleCriteriaMapper.java | 2 +- .../support/querybyexample/package-info.java | 3 +- .../spel/QueryStringSpELEvaluator.java | 2 +- .../repository/support/spel/package-info.java | 3 +- ...earchCollectionValueToStringConverter.java | 2 +- ...sticsearchQueryValueConversionService.java | 2 +- ...ticsearchStringValueToStringConverter.java | 2 +- .../support/value/package-info.java | 3 +- .../support/DefaultStringObjectMap.java | 2 +- .../elasticsearch/support/HttpHeaders.java | 2 +- .../data/elasticsearch/support/ScoreDoc.java | 2 +- .../support/StringObjectMap.java | 2 +- .../elasticsearch/support/VersionInfo.java | 2 +- .../elasticsearch/support/package-info.java | 3 +- .../NestedObjectIntegrationTests.java | 2 +- .../NullabilityArchitectureTests.java | 21 ++ .../ComposableAnnotationsUnitTest.java | 2 +- .../elc/CriteriaQueryMappingUnitTests.java | 2 +- .../elasticsearch/client/elc/DevTests.java | 2 +- .../client/elc/ELCWiremockTests.java | 3 +- .../client/elc/RequestConverterTest.java | 6 +- .../client/util/package-info.java | 3 +- .../config/AuditingIntegrationTests.java | 2 +- .../AuditingReactiveIntegrationTest.java | 2 +- .../ElasticsearchConfigurationELCTests.java | 2 +- ...iveElasticsearchConfigurationELCTests.java | 2 +- ...bleNestedRepositoriesIntegrationTests.java | 5 +- .../EnableRepositoriesIntegrationTests.java | 22 +- .../config/notnested/package-info.java | 3 +- .../ElasticsearchELCIntegrationTests.java | 2 +- .../core/ElasticsearchIntegrationTests.java | 59 ++-- .../core/EntityOperationsUnitTests.java | 2 +- .../core/InnerHitsIntegrationTests.java | 2 +- .../core/LogEntityIntegrationTests.java | 5 +- .../core/PointInTimeIntegrationTests.java | 2 +- ...ctiveElasticsearchELCIntegrationTests.java | 2 +- ...ReactiveElasticsearchIntegrationTests.java | 17 +- .../ReactivePointInTimeIntegrationTests.java | 2 +- .../core/ReactiveReindexIntegrationTests.java | 2 +- ...eactiveSearchTemplateIntegrationTests.java | 2 +- .../core/ReindexIntegrationTests.java | 2 +- .../core/SearchAsYouTypeIntegrationTests.java | 2 +- .../core/SearchTemplateIntegrationTests.java | 2 +- .../core/SourceFilterIntegrationTests.java | 4 +- .../AggregationIntegrationTests.java | 4 +- ...appingElasticsearchConverterUnitTests.java | 22 +- .../PropertyValueConvertersUnitTests.java | 2 +- .../event/AuditingEntityCallbackTests.java | 2 +- .../core/event/CallbackIntegrationTests.java | 4 +- .../ReactiveAuditingEntityCallbackTests.java | 2 +- .../ReactiveCallbackIntegrationTests.java | 2 +- .../core/geo/GeoIntegrationTests.java | 2 +- .../elasticsearch/core/geo/GeoJsonEntity.java | 2 +- .../core/geo/GeoJsonIntegrationTests.java | 2 +- .../IndexOperationsIntegrationTests.java | 2 +- .../index/IndexTemplateIntegrationTests.java | 2 +- .../index/MappingBuilderIntegrationTests.java | 7 +- .../core/index/MappingBuilderUnitTests.java | 99 +++--- .../core/index/MappingParametersTest.java | 3 +- ...activeIndexOperationsIntegrationTests.java | 2 +- ...ReactiveIndexTemplateIntegrationTests.java | 2 +- .../ReactiveMappingBuilderUnitTests.java | 2 +- .../SimpleDynamicTemplatesMappingTests.java | 2 +- .../SimpleElasticsearchDateMappingTests.java | 2 +- ...ntityCustomConversionIntegrationTests.java | 2 +- .../FieldNamingStrategyIntegrationTests.java | 2 +- ...veFieldNamingStrategyIntegrationTests.java | 2 +- ...pleElasticsearchPersistentEntityTests.java | 4 +- ...sticsearchPersistentPropertyUnitTests.java | 2 +- .../ReactiveSearchAfterIntegrationTests.java | 2 +- .../SearchAfterIntegrationTests.java | 2 +- .../core/paginating/package-info.java | 3 +- .../query/CriteriaQueryIntegrationTests.java | 8 +- .../query/NativeQueryIntegrationTests.java | 2 +- .../RepositoryPartQueryIntegrationTests.java | 2 +- ...iptedAndRuntimeFieldsIntegrationTests.java | 2 +- ...iptedAndRuntimeFieldsIntegrationTests.java | 2 +- .../sort/NestedSortIntegrationTests.java | 2 +- .../DefaultRoutingResolverUnitTest.java | 15 +- .../core/routing/ReactiveRoutingTests.java | 2 +- .../core/routing/RoutingIntegrationTests.java | 2 +- ...ReactiveSqlOperationsIntegrationTests.java | 2 +- .../sql/SqlOperationsIntegrationTests.java | 2 +- .../suggest/CompletionIntegrationTests.java | 2 +- ...ompletionWithContextsIntegrationTests.java | 2 +- .../ReactiveSuggestIntegrationTests.java | 2 +- .../ImmutableRepositoryIntegrationTests.java | 2 +- .../junit/jupiter/ClusterConnection.java | 3 +- .../junit/jupiter/ClusterConnectionInfo.java | 2 +- .../junit/jupiter/package-info.java | 2 +- .../repositories/cdi/CdiRepositoryClient.java | 2 +- .../repositories/cdi/CdiRepositoryTests.java | 8 +- .../repositories/cdi/package-info.java | 3 +- ...ustomMethodRepositoryIntegrationTests.java | 2 +- ...epositoryManualWiringIntegrationTests.java | 2 +- ...ustomMethodRepositoryIntegrationTests.java | 7 +- .../geo/GeoRepositoryIntegrationTests.java | 2 +- .../knn/KnnSearchIntegrationTests.java | 2 +- .../InnerObjectIntegrationTests.java | 2 +- .../SynonymRepositoryIntegrationTests.java | 2 +- ...asticsearchRepositoryIntegrationTests.java | 7 +- ...asticsearchRepositoriesRegistrarTests.java | 2 +- .../ElasticsearchQueryMethodUnitTests.java | 2 +- ...tiveElasticsearchQueryMethodUnitTests.java | 4 +- ...epositorySearchTemplateQueryUnitTests.java | 2 +- ...eactiveRepositoryStringQueryUnitTests.java | 4 +- ...epositorySearchTemplateQueryUnitTests.java | 2 +- .../query/RepositoryStringQueryUnitTests.java | 2 +- .../QueryKeywordsIntegrationTests.java | 2 +- ...ReactiveQueryKeywordsIntegrationTests.java | 2 +- ...eactiveValueConverterIntegrationTests.java | 31 +- .../ValueConverterIntegrationTests.java | 2 +- ...asticsearchRepositoryIntegrationTests.java | 7 +- ...activeRepositoryQueryIntegrationTests.java | 2 +- .../RepositoryQueryIntegrationTests.java | 2 +- ...asticsearchRepositoryIntegrationTests.java | 7 +- ...ElasticsearchExecutorIntegrationTests.java | 7 +- ...ElasticsearchExecutorIntegrationTests.java | 14 +- 299 files changed, 707 insertions(+), 767 deletions(-) create mode 100644 src/test/java/org/springframework/data/elasticsearch/NullabilityArchitectureTests.java diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/auditing.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/auditing.adoc index d02373f82..f9633dec4 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/auditing.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/auditing.adoc @@ -10,7 +10,7 @@ In order for the auditing code to be able to decide whether an entity instance i ---- package org.springframework.data.domain; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; public interface Persistable { @Nullable @@ -81,5 +81,5 @@ class MyConfiguration { } ---- -If your code contains more than one `AuditorAware` bean for different types, you must provide the name of the bean to use as an argument to the `auditorAwareRef` parameter of the - `@EnableElasticsearchAuditing` annotation. +If your code contains more than one `AuditorAware` bean for different types, you must provide the name of the bean to use as an argument to the `auditorAwareRef` parameter of the + `@EnableElasticsearchAuditing` annotation. diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc index 38345d424..64d4a0c00 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/scripted-and-runtime-fields.adoc @@ -20,12 +20,12 @@ Whereas the birthdate is fix, the age depends on the time when a query is issued ==== [source,java] ---- +import org.jspecify.annotations.Nullable; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.ScriptedField; -import org.springframework.lang.Nullable; import java.time.LocalDate; import java.time.format.DateTimeFormatter; diff --git a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java index d0622bfa5..22dbbfd7c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java +++ b/src/main/java/org/springframework/data/elasticsearch/ElasticsearchErrorCause.java @@ -15,10 +15,10 @@ */ package org.springframework.data.elasticsearch; -import org.springframework.lang.Nullable; - import java.util.List; +import org.jspecify.annotations.Nullable; + /** * Object describing an Elasticsearch error * @@ -26,8 +26,7 @@ * @since 4.4 */ public class ElasticsearchErrorCause { - @Nullable - private final String type; + @Nullable private final String type; private final String reason; diff --git a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java index ca70b022b..ffc71ef7b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java +++ b/src/main/java/org/springframework/data/elasticsearch/UncategorizedElasticsearchException.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch; +import org.jspecify.annotations.Nullable; import org.springframework.dao.UncategorizedDataAccessException; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/annotations/package-info.java b/src/main/java/org/springframework/data/elasticsearch/annotations/package-info.java index 60fe25267..4b8ccdf64 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.annotations; diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java index f135eaddd..100b2ae44 100644 --- a/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/aot/SpringDataElasticsearchRuntimeHints.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import org.jspecify.annotations.Nullable; import org.springframework.aot.hint.MemberCategory; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; @@ -32,7 +33,6 @@ import org.springframework.data.elasticsearch.core.event.ReactiveAfterLoadCallback; import org.springframework.data.elasticsearch.core.event.ReactiveAfterSaveCallback; import org.springframework.data.elasticsearch.core.event.ReactiveBeforeConvertCallback; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/aot/package-info.java b/src/main/java/org/springframework/data/elasticsearch/aot/package-info.java index 292bf8a1a..56697c102 100644 --- a/src/main/java/org/springframework/data/elasticsearch/aot/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/aot/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.aot; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java index bbd7e360b..f092e2bf6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfiguration.java @@ -25,8 +25,8 @@ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.support.HttpHeaders; -import org.springframework.lang.Nullable; /** * Configuration interface exposing common client configuration properties for Elasticsearch clients. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java index 247bc9be9..71af99212 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/ClientConfigurationBuilder.java @@ -25,11 +25,11 @@ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.client.ClientConfiguration.ClientConfigurationBuilderWithRequiredEndpoint; import org.springframework.data.elasticsearch.client.ClientConfiguration.MaybeSecureClientConfigurationBuilder; import org.springframework.data.elasticsearch.client.ClientConfiguration.TerminalClientConfigurationBuilder; import org.springframework.data.elasticsearch.support.HttpHeaders; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java index d13f556c7..ea097bbb5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/DefaultClientConfiguration.java @@ -24,9 +24,8 @@ import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLContext; -import org.elasticsearch.client.RestClientBuilder.HttpClientConfigCallback; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.support.HttpHeaders; -import org.springframework.lang.Nullable; /** * Default {@link ClientConfiguration} implementation. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java index d882ddb1f..ff0e1bd3a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/AbstractQueryProcessor.java @@ -17,10 +17,10 @@ import java.util.function.Consumer; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.StringQuery; -import org.springframework.lang.Nullable; /** * An abstract class that serves as a base for query processors. It provides a common interface and basic functionality @@ -38,8 +38,8 @@ public abstract class AbstractQueryProcessor { * @param queryConverter correct mapped field names and the values to the converted values. * @return an Elasticsearch {@literal query}. */ - @Nullable - static co.elastic.clients.elasticsearch._types.query_dsl.Query getEsQuery(@Nullable Query query, + + static co.elastic.clients.elasticsearch._types.query_dsl.@Nullable Query getEsQuery(@Nullable Query query, @Nullable Consumer queryConverter) { if (query == null) { return null; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java index 51bc9bccd..1c9c9ef53 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryProcessor.java @@ -31,13 +31,13 @@ import java.util.List; import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.core.query.Criteria; import org.springframework.data.elasticsearch.core.query.Field; import org.springframework.data.elasticsearch.core.query.HasChildQuery; import org.springframework.data.elasticsearch.core.query.HasParentQuery; import org.springframework.data.elasticsearch.core.query.InnerHitsQuery; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java index 5996bada3..ccb937bf7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java @@ -34,6 +34,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.MultiGetItem; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.document.Explanation; @@ -41,7 +42,6 @@ import org.springframework.data.elasticsearch.core.document.SearchDocument; import org.springframework.data.elasticsearch.core.document.SearchDocumentAdapter; import org.springframework.data.elasticsearch.core.document.SearchDocumentResponse; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -160,7 +160,7 @@ public static SearchDocument from(CompletionSuggestOption completio } @Nullable - private static Explanation from(@Nullable co.elastic.clients.elasticsearch.core.explain.Explanation explanation) { + private static Explanation from(co.elastic.clients.elasticsearch.core.explain.@Nullable Explanation explanation) { if (explanation == null) { return null; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java index 4f257c3e3..95e778802 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchAggregations.java @@ -22,8 +22,8 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.AggregationsContainer; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java index dcb92f5cf..2ca7fcbb8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClientFactoryBean.java @@ -19,12 +19,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.FactoryBeanNotInitializedException; import org.springframework.beans.factory.InitializingBean; import org.springframework.data.elasticsearch.client.ClientConfiguration; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java index 286d6a9dc..c4f6452cc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchClients.java @@ -46,9 +46,9 @@ import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClientBuilder; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.client.ClientConfiguration; import org.springframework.data.elasticsearch.support.HttpHeaders; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java index 70b76bc5b..3e0d6235d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ElasticsearchTemplate.java @@ -40,6 +40,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.BulkFailureException; import org.springframework.data.elasticsearch.client.UnsupportedBackendOperation; import org.springframework.data.elasticsearch.core.AbstractElasticsearchTemplate; @@ -59,7 +60,6 @@ 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; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java index 6ef0ea506..dfe850e4d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/HighlightQueryBuilder.java @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.core.query.highlight.Highlight; @@ -27,7 +28,6 @@ import org.springframework.data.elasticsearch.core.query.highlight.HighlightFieldParameters; import org.springframework.data.elasticsearch.core.query.highlight.HighlightParameters; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** @@ -43,7 +43,8 @@ class HighlightQueryBuilder { private final RequestConverter requestConverter; HighlightQueryBuilder( - MappingContext, ElasticsearchPersistentProperty> mappingContext, RequestConverter requestConverter) { + MappingContext, ElasticsearchPersistentProperty> mappingContext, + RequestConverter requestConverter) { this.mappingContext = mappingContext; this.requestConverter = requestConverter; } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java index d4c087455..5a735a724 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/IndicesTemplate.java @@ -27,6 +27,7 @@ import java.util.Objects; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.UncategorizedElasticsearchException; @@ -49,7 +50,6 @@ import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java index 3260b5a79..5a927774f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/JsonUtils.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * @author Peter-Josef Meisch @@ -48,7 +48,7 @@ public static String toJson(Object object, JsonpMapper mapper) { } @Nullable - public static String queryToJson(@Nullable co.elastic.clients.elasticsearch._types.query_dsl.Query query, + public static String queryToJson(co.elastic.clients.elasticsearch._types.query_dsl.@Nullable Query query, JsonpMapper mapper) { if (query == null) { diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java index 44540494b..d8d2d21ae 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQuery.java @@ -28,8 +28,8 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.BaseQuery; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -44,7 +44,7 @@ public class NativeQuery extends BaseQuery { @Nullable private final Query query; - @Nullable private org.springframework.data.elasticsearch.core.query.Query springDataQuery; + private org.springframework.data.elasticsearch.core.query.@Nullable Query springDataQuery; @Nullable private Query filter; // note: the new client does not have pipeline aggs, these are just set up as normal aggs private final Map aggregations = new LinkedHashMap<>(); @@ -117,7 +117,7 @@ public Map getSearchExtensions() { * @see NativeQueryBuilder#withQuery(org.springframework.data.elasticsearch.core.query.Query). * @since 5.1 */ - public void setSpringDataQuery(@Nullable org.springframework.data.elasticsearch.core.query.Query springDataQuery) { + public void setSpringDataQuery(org.springframework.data.elasticsearch.core.query.@Nullable Query springDataQuery) { this.springDataQuery = springDataQuery; } @@ -129,8 +129,7 @@ public List getKnnSearches() { return knnSearches; } - @Nullable - public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() { + public org.springframework.data.elasticsearch.core.query.@Nullable Query getSpringDataQuery() { return springDataQuery; } } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java index 1cdd15c04..e8a1e748a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/NativeQueryBuilder.java @@ -33,8 +33,8 @@ import java.util.Map; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.BaseQueryBuilder; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -53,7 +53,7 @@ public class NativeQueryBuilder extends BaseQueryBuilder sortOptions = new ArrayList<>(); private final Map searchExtensions = new LinkedHashMap<>(); - @Nullable private org.springframework.data.elasticsearch.core.query.Query springDataQuery; + private org.springframework.data.elasticsearch.core.query.@Nullable Query springDataQuery; @Nullable private KnnQuery knnQuery; @Nullable private List knnSearches = Collections.emptyList(); @@ -104,8 +104,7 @@ public List getKnnSearches() { return knnSearches; } - @Nullable - public org.springframework.data.elasticsearch.core.query.Query getSpringDataQuery() { + public org.springframework.data.elasticsearch.core.query.@Nullable Query getSpringDataQuery() { return springDataQuery; } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java index 1d254cb27..7259f0ca4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/Queries.java @@ -34,9 +34,9 @@ import java.util.List; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.geo.GeoPoint; import org.springframework.data.elasticsearch.core.query.BaseQueryBuilder; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java index bcae5acc8..7241fa7b8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClient.java @@ -30,7 +30,7 @@ import java.io.IOException; import java.util.function.Function; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java index 5d4fbcef1..b90f0da96 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchClusterClient.java @@ -16,7 +16,15 @@ package org.springframework.data.elasticsearch.client.elc; import co.elastic.clients.ApiClient; -import co.elastic.clients.elasticsearch.cluster.*; +import co.elastic.clients.elasticsearch.cluster.DeleteComponentTemplateRequest; +import co.elastic.clients.elasticsearch.cluster.DeleteComponentTemplateResponse; +import co.elastic.clients.elasticsearch.cluster.ExistsComponentTemplateRequest; +import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateRequest; +import co.elastic.clients.elasticsearch.cluster.GetComponentTemplateResponse; +import co.elastic.clients.elasticsearch.cluster.HealthRequest; +import co.elastic.clients.elasticsearch.cluster.HealthResponse; +import co.elastic.clients.elasticsearch.cluster.PutComponentTemplateRequest; +import co.elastic.clients.elasticsearch.cluster.PutComponentTemplateResponse; import co.elastic.clients.transport.ElasticsearchTransport; import co.elastic.clients.transport.TransportOptions; import co.elastic.clients.transport.endpoints.BooleanResponse; @@ -25,7 +33,7 @@ import java.util.function.Function; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Reactive version of the {@link co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterClient} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java index 50b859423..e5f6df392 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java @@ -25,7 +25,7 @@ import java.util.function.Function; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Reactive version of the {@link co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient} diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java index 78bd2213a..a98e41ab9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchTemplate.java @@ -40,6 +40,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.reactivestreams.Publisher; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.BulkFailureException; @@ -63,7 +64,6 @@ 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; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java index 0ac64fa12..235905ce5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveIndicesTemplate.java @@ -29,6 +29,7 @@ import java.util.Objects; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.NoSuchIndexException; @@ -51,7 +52,6 @@ import org.springframework.data.elasticsearch.core.mapping.CreateIndexSettings; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** 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 658b2caee..a8d8beabe 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 @@ -78,6 +78,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.core.RefreshPolicy; @@ -101,7 +102,6 @@ import org.springframework.data.elasticsearch.core.reindex.Remote; import org.springframework.data.elasticsearch.core.script.Script; import org.springframework.data.elasticsearch.support.DefaultStringObjectMap; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -738,8 +738,7 @@ private CreateOperation bulkCreateOperation(IndexQuery query, IndexCoordinate return uob.build(); } - @Nullable - private co.elastic.clients.elasticsearch._types.Script getScript(@Nullable ScriptData scriptData) { + private co.elastic.clients.elasticsearch._types.@Nullable Script getScript(@Nullable ScriptData scriptData) { if (scriptData == null) { return null; @@ -1729,7 +1728,7 @@ private SortOptions getSortOptions(Sort.Order order, @Nullable ElasticsearchPers } @Nullable - private NestedSortValue getNestedSort(@Nullable Order.Nested nested, + private NestedSortValue getNestedSort(Order.@Nullable Nested nested, @Nullable ElasticsearchPersistentEntity persistentEntity) { return (nested == null || persistentEntity == null) ? null : NestedSortValue.of(b -> b // @@ -1793,8 +1792,7 @@ private void prepareNativeSearch(NativeQuery query, MultisearchBody.Builder buil } } - @Nullable - co.elastic.clients.elasticsearch._types.query_dsl.Query getQuery(@Nullable Query query, + co.elastic.clients.elasticsearch._types.query_dsl.@Nullable Query getQuery(@Nullable Query query, @Nullable Class clazz) { return getEsQuery(query, (q) -> elasticsearchConverter.updateQuery(q, clazz)); } 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 ad6a44d58..7024584f3 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 @@ -48,6 +48,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.ElasticsearchErrorCause; import org.springframework.data.elasticsearch.core.IndexInformation; import org.springframework.data.elasticsearch.core.MultiGetItem; @@ -65,7 +66,6 @@ import org.springframework.data.elasticsearch.core.script.Script; import org.springframework.data.elasticsearch.core.sql.SqlResponse; import org.springframework.data.elasticsearch.support.DefaultStringObjectMap; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -415,8 +415,7 @@ private ByQueryResponse.Failure byQueryResponseFailureOf(BulkIndexByScrollFailur .withErrorCause(toErrorCause(failure.cause())).build(); } - @Nullable - public static MultiGetItem.Failure getFailure(MultiGetResponseItem itemResponse) { + public static MultiGetItem.@Nullable Failure getFailure(MultiGetResponseItem itemResponse) { MultiGetError responseFailure = itemResponse.isFailure() ? itemResponse.failure() : null; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java index f9afa4fad..94a6ab1e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/SearchDocumentResponseBuilder.java @@ -39,6 +39,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.SearchShardStatistics; import org.springframework.data.elasticsearch.core.TotalHitsRelation; import org.springframework.data.elasticsearch.core.document.SearchDocument; @@ -48,7 +49,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.elasticsearch.core.suggest.response.TermSuggestion; import org.springframework.data.elasticsearch.support.ScoreDoc; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; @@ -133,7 +133,8 @@ public static SearchDocumentResponse from(SearchTemplateResponse SearchDocumentResponse from(HitsMetadata hitsMetadata, @Nullable ShardStatistics shards, - @Nullable String scrollId, @Nullable String pointInTimeId, long executionDurationInMillis, @Nullable Map aggregations, + @Nullable String scrollId, @Nullable String pointInTimeId, long executionDurationInMillis, + @Nullable Map aggregations, Map>> suggestES, SearchDocumentResponse.EntityCreator entityCreator, JsonpMapper jsonpMapper) { @@ -171,7 +172,8 @@ public static SearchDocumentResponse from(HitsMetadata hitsMetadata, @Nul SearchShardStatistics shardStatistics = shards != null ? shardsFrom(shards) : null; - return new SearchDocumentResponse(totalHits, totalHitsRelation, maxScore, executionDuration, scrollId, pointInTimeId, searchDocuments, + return new SearchDocumentResponse(totalHits, totalHitsRelation, maxScore, executionDuration, scrollId, + pointInTimeId, searchDocuments, aggregationsContainer, suggest, shardStatistics); } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java index 43747f3a7..db38baf13 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/TypeUtils.java @@ -38,6 +38,7 @@ import java.util.Map; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.core.RefreshPolicy; import org.springframework.data.elasticsearch.core.document.Document; @@ -52,7 +53,6 @@ import org.springframework.data.elasticsearch.core.query.types.ConflictsType; import org.springframework.data.elasticsearch.core.query.types.OperatorType; import org.springframework.data.elasticsearch.core.reindex.ReindexRequest; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -220,7 +220,7 @@ static GeoDistanceType geoDistanceType(GeoDistanceOrder.DistanceType distanceTyp } @Nullable - static SortOrder sortOrder(@Nullable Sort.Direction direction) { + static SortOrder sortOrder(Sort.@Nullable Direction direction) { if (direction == null) { return null; @@ -301,7 +301,7 @@ static HighlighterTagsSchema highlighterTagsSchema(@Nullable String value) { } @Nullable - static OpType opType(@Nullable IndexQuery.OpType opType) { + static OpType opType(IndexQuery.@Nullable OpType opType) { if (opType != null) { return switch (opType) { @@ -325,8 +325,7 @@ static Refresh refresh(@Nullable RefreshPolicy refreshPolicy) { }; } - @Nullable - static UpdateResponse.Result result(@Nullable Result result) { + static UpdateResponse.@Nullable Result result(@Nullable Result result) { if (result == null) { return null; @@ -343,7 +342,7 @@ static UpdateResponse.Result result(@Nullable Result result) { } @Nullable - static ScoreMode scoreMode(@Nullable RescorerQuery.ScoreMode scoreMode) { + static ScoreMode scoreMode(RescorerQuery.@Nullable ScoreMode scoreMode) { if (scoreMode == null) { return null; @@ -361,7 +360,7 @@ static ScoreMode scoreMode(@Nullable RescorerQuery.ScoreMode scoreMode) { } @Nullable - static SearchType searchType(@Nullable Query.SearchType searchType) { + static SearchType searchType(Query.@Nullable SearchType searchType) { if (searchType == null) { return null; @@ -418,7 +417,7 @@ static String timeStringMs(@Nullable Duration duration) { @Nullable static VersionType versionType( - @Nullable org.springframework.data.elasticsearch.annotations.Document.VersionType versionType) { + org.springframework.data.elasticsearch.annotations.Document.@Nullable VersionType versionType) { if (versionType != null) { return switch (versionType) { @@ -536,7 +535,7 @@ static Conflicts conflicts(@Nullable ConflictsType conflicts) { * @param scoreMode spring-data-elasticsearch {@literal scoreMode}. * @return an Elasticsearch {@literal scoreMode}. */ - static ChildScoreMode scoreMode(@Nullable HasChildQuery.ScoreMode scoreMode) { + static ChildScoreMode scoreMode(HasChildQuery.@Nullable ScoreMode scoreMode) { if (scoreMode == null) { return ChildScoreMode.None; } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java index 47fb2a8e1..2c177a13a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/ElasticsearchClientRuntimeHints.java @@ -19,11 +19,11 @@ import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; import co.elastic.clients.elasticsearch.indices.IndexSettings; import co.elastic.clients.elasticsearch.indices.PutMappingRequest; -import org.springframework.aot.hint.MemberCategory; + +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.lang.Nullable; /** * runtime hints for the Elasticsearch client libraries, as these do not provide any of their own. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/package-info.java index 7d6be368b..2718c30fb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/aot/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.client.elc.aot; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java index 8dc2f99df..011b5f7fb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/package-info.java @@ -18,6 +18,5 @@ * This package contains classes that use the new Elasticsearch client library (co.elastic.clients:elasticsearch-java) * to access Elasticsearch. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.client.elc; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/package-info.java index 3594797d6..1aa3d179a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.client; diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java index f901706c1..a20805ad2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/util/ScrollState.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Set; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/package-info.java b/src/main/java/org/springframework/data/elasticsearch/client/util/package-info.java index 79701328c..3e0be8092 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/util/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/util/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.client.util; diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java index 9152ed57b..527ae4ad1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchAuditingBeanDefinitionParser.java @@ -17,6 +17,7 @@ import static org.springframework.data.config.ParsingUtils.*; +import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; @@ -28,7 +29,6 @@ import org.springframework.data.elasticsearch.core.event.AuditingEntityCallback; import org.springframework.data.elasticsearch.core.event.ReactiveAuditingEntityCallback; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; -import org.springframework.lang.Nullable; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; import org.w3c.dom.Element; diff --git a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java index 4a8d78b69..725382eaa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/ElasticsearchConfigurationSupport.java @@ -20,6 +20,7 @@ import java.util.HashSet; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.mapping.model.FieldNamingStrategy; import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; -import org.springframework.lang.Nullable; import org.springframework.util.ClassUtils; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/config/package-info.java b/src/main/java/org/springframework/data/elasticsearch/config/package-info.java index 6461b9824..351c2495d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/config/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/config/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.config; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java index d6074a4fa..6a0870375 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java @@ -24,6 +24,7 @@ import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; @@ -57,7 +58,6 @@ import org.springframework.data.mapping.callback.EntityCallbacks; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.util.Streamable; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java index a2449b2a7..a3b313e53 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/AbstractReactiveElasticsearchTemplate.java @@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; import org.springframework.beans.BeansException; @@ -56,7 +57,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.elasticsearch.support.VersionInfo; import org.springframework.data.mapping.callback.ReactiveEntityCallbacks; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java index d855b0a6a..b0ab53bc6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DocumentOperations.java @@ -18,6 +18,7 @@ import java.util.Collection; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.query.BulkOptions; import org.springframework.data.elasticsearch.core.query.ByQueryResponse; @@ -28,7 +29,6 @@ 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.lang.Nullable; /** * The operations for the diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java index 3bc75f2e4..954b123c7 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchOperations.java @@ -15,13 +15,13 @@ */ package org.springframework.data.elasticsearch.core; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.cluster.ClusterOperations; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.routing.RoutingResolver; import org.springframework.data.elasticsearch.core.script.ScriptOperations; import org.springframework.data.elasticsearch.core.sql.SqlOperations; -import org.springframework.lang.Nullable; /** * ElasticsearchOperations. Since 4.0 this interface only contains common helper functions, the other methods have been diff --git a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java index 07a7e61d1..f1e3b64d4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/EntityOperations.java @@ -17,6 +17,7 @@ import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.ConversionService; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.join.JoinField; @@ -29,7 +30,6 @@ import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.mapping.model.ConvertingPropertyAccessor; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -123,7 +123,7 @@ public T updateIndexedObject(T entity, // Only deal with text because ES generated Ids are strings! if (indexedObjectInformation.id() != null && idProperty != null - // isReadable from the base class is false in case of records + // isReadable from the base class is false in case of records && (idProperty.isReadable() || idProperty.getOwner().getType().isRecord()) && idProperty.getType().isAssignableFrom(String.class)) { propertyAccessor.setProperty(idProperty, indexedObjectInformation.id()); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java index 11b03cadf..cff054315 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexInformation.java @@ -18,10 +18,10 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.index.AliasData; import org.springframework.data.elasticsearch.core.index.Settings; -import org.springframework.lang.Nullable; /** * Immutable object that holds information(name, settings, mappings, aliases) about an Index diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java index d7e583a4d..66bf1cf0b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperations.java @@ -19,10 +19,10 @@ import java.util.Map; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.index.*; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.lang.Nullable; /** * The operations for the diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java index b8c1d371a..a62ba0533 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java @@ -22,10 +22,10 @@ import java.util.Objects; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.index.*; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java index 6bd25bc88..91b259a7d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/IndexedObjectInformation.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Value class capturing information about a newly indexed document in Elasticsearch. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java index ad7795e66..a28f83fd4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.ElasticsearchErrorCause; -import org.springframework.lang.Nullable; /** * Response object for items returned from multiget requests, encapsulating the returned data and potential error diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java index 1942fd659..91554fa0d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchOperations.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.cluster.ReactiveClusterOperations; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; @@ -22,7 +23,6 @@ import org.springframework.data.elasticsearch.core.routing.RoutingResolver; import org.springframework.data.elasticsearch.core.script.ReactiveScriptOperations; import org.springframework.data.elasticsearch.core.sql.ReactiveSqlOperations; -import org.springframework.lang.Nullable; /** * Interface that specifies a basic set of Elasticsearch operations executed in a reactive way. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java index c83ea8ea9..2d84a5457 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHits.java @@ -19,8 +19,8 @@ import java.time.Duration; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; -import org.springframework.lang.Nullable; /** * Encapsulates a Flux of {@link SearchHit}s with additional information from the search. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java index e932b38ae..604bd5959 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java @@ -19,8 +19,8 @@ import java.time.Duration; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java index 238d90b21..da59efdf5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java @@ -23,9 +23,9 @@ import java.util.Map; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Explanation; import org.springframework.data.elasticsearch.core.document.NestedMetaData; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java index d636715f6..bba964246 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.UncategorizedElasticsearchException; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.document.Document; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.CompletionSuggestion; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java index d4e8b0441..d9ed18aeb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java @@ -21,11 +21,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.data.util.CloseableIterator; import org.springframework.data.util.ReactiveWrappers; -import org.springframework.lang.Nullable; /** * Utility class with helper methods for working with {@link SearchHit}. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java index e41f4f521..47276a493 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java @@ -19,9 +19,9 @@ import java.util.Iterator; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.util.Streamable; -import org.springframework.lang.Nullable; /** * Encapsulates a list of {@link SearchHit}s with additional information from the search. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java index f3949787f..50a11a174 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java @@ -19,9 +19,9 @@ import java.util.Collections; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.util.Lazy; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java index cff034fa3..a24f547ad 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java @@ -17,8 +17,8 @@ import java.time.Duration; +import org.jspecify.annotations.Nullable; import org.springframework.data.util.CloseableIterator; -import org.springframework.lang.Nullable; /** * A {@link SearchHitsIterator} encapsulates {@link SearchHit} results that can be wrapped in a Java 8 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java index 934737dd5..d738f1fb5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java @@ -18,11 +18,11 @@ import java.time.Duration; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.query.BaseQueryBuilder; import org.springframework.data.elasticsearch.core.query.MoreLikeThisQuery; import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.lang.Nullable; /** * The operations for the @@ -233,7 +233,8 @@ List> multiSearch(List queries, List> cl Query idsQuery(List ids); /** - * Creates a {@link BaseQueryBuilder} that has the given ids setto the parameter value. No other properties of the bulder are set. + * Creates a {@link BaseQueryBuilder} that has the given ids setto the parameter value. No other properties of the + * bulder are set. * * @param ids the list of ids must not be {@literal null} * @return query returning the documents with the given ids diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java index 7a47e3e6c..291472bb0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchScrollHits.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * This interface is used to expose the current {@code scrollId} from the underlying scroll context. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java index 293d2e7a0..c6ddef428 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchShardStatistics.java @@ -17,8 +17,8 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.ElasticsearchErrorCause; -import org.springframework.lang.Nullable; /** * @author Haibo Liu diff --git a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java index 62319e4b5..d96e643e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java @@ -23,8 +23,8 @@ import java.util.function.Consumer; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.client.util.ScrollState; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/cluster/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/cluster/package-info.java index 6d49233c5..8532409aa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/cluster/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/cluster/package-info.java @@ -1,6 +1,5 @@ /** * Interfaces and classes related to Elasticsearch cluster information and management. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.cluster; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java index 9fc8532e8..1303d5af7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/DefaultElasticsearchTypeMapper.java @@ -19,6 +19,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.convert.DefaultTypeMapper; import org.springframework.data.convert.SimpleTypeInformationMapper; import org.springframework.data.convert.TypeAliasAccessor; @@ -27,7 +28,6 @@ import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; /** * Elasticsearch specific {@link org.springframework.data.convert.TypeMapper} implementation. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java index 8e1300547..a078bde2b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchConverter.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.core.convert; +import org.jspecify.annotations.Nullable; import org.springframework.data.convert.EntityConverter; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; @@ -23,7 +24,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.projection.ProjectionFactory; import org.springframework.data.projection.SpelAwareProxyProjectionFactory; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java index dc6a54f37..fa4f6e4e5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java @@ -17,11 +17,11 @@ import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.convert.TypeMapper; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.lang.Nullable; /** * Elasticsearch specific {@link TypeMapper} definition. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java index 9b06cc3f6..e823105ad 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingConversionException.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.convert; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * @since 5.3 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java index 441a95c53..3b757e18d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.springframework.beans.BeansException; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationContext; @@ -65,7 +66,6 @@ import org.springframework.data.util.TypeInformation; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.format.datetime.DateFormatterRegistrar; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; import org.springframework.util.CollectionUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/convert/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/convert/package-info.java index 5ce581e58..88db6c0aa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/convert/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/convert/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.convert; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java b/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java index 8c9917c60..db17704d0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java @@ -20,9 +20,9 @@ import java.util.Map; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.convert.ConversionException; import org.springframework.data.elasticsearch.support.StringObjectMap; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java b/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java index 48135b226..5e62be4c9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/Explanation.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Objects; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java index 669313195..3b435e39b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/MapDocument.java @@ -21,10 +21,9 @@ import java.util.Set; import java.util.function.BiConsumer; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.support.DefaultStringObjectMap; -import org.springframework.data.elasticsearch.support.StringObjectMap; import org.springframework.data.mapping.MappingException; -import org.springframework.lang.Nullable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java b/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java index 3294e7a6f..727e9a6a4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/NestedMetaData.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.document; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * meta data returned for nested inner hits. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java index 2fb158f29..63192272e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Extension to {@link Document} exposing search response related data. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java index e2549aada..de424c719 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java @@ -22,7 +22,7 @@ import java.util.Set; import java.util.function.BiConsumer; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * {@link SearchDocument} implementation using a {@link Document} delegate. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java index 8430aad56..a4256f330 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentResponse.java @@ -20,10 +20,10 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.AggregationsContainer; import org.springframework.data.elasticsearch.core.SearchShardStatistics; import org.springframework.data.elasticsearch.core.suggest.response.Suggest; -import org.springframework.lang.Nullable; /** * This represents the complete search response from Elasticsearch, including the returned documents. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/document/package-info.java index 03bee729b..514f80ad1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/package-info.java @@ -1,6 +1,5 @@ /** * Classes related to the Document structure of Elasticsearch documents and search responses. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.document; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/event/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/event/package-info.java index a48d01eb0..f596552bf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/event/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/event/package-info.java @@ -1,6 +1,5 @@ /** * classes and interfaces related to Spring Data Elasticsearch events and callbacks. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.event; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/geo/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/geo/package-info.java index bb92b2929..b3dc72af0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/geo/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/geo/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.geo; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java index 1b71a8aa0..254b1b8eb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.index; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java index 44c3869c5..cc18d6aba 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.List; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Class to define to actions to execute in alias management functions. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java index 615de488c..0625c6894 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/AliasData.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.index; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.lang.Nullable; /** * value object to describe alias information. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java index b67d41114..169847080 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ComponentTemplateRequestData.java @@ -17,8 +17,8 @@ import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java index e34da7b70..0abcebc83 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/GeoShapeMappingParameters.java @@ -17,8 +17,8 @@ import java.io.IOException; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.GeoShapeField; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import com.fasterxml.jackson.databind.node.ObjectNode; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java index 6d839dfe4..a01c9526f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java @@ -29,6 +29,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.core.io.ClassPathResource; import org.springframework.data.annotation.Transient; import org.springframework.data.elasticsearch.annotations.*; @@ -42,7 +43,6 @@ import org.springframework.data.mapping.MappingException; import org.springframework.data.mapping.PropertyHandler; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; import org.springframework.util.StreamUtils; import org.springframework.util.StringUtils; @@ -130,14 +130,13 @@ public String buildPropertyMapping(Class clazz) throws MappingException { } protected String buildPropertyMapping(ElasticsearchPersistentEntity entity, - @Nullable org.springframework.data.elasticsearch.core.document.Document runtimeFields) { + org.springframework.data.elasticsearch.core.document.@Nullable Document runtimeFields) { InternalBuilder internalBuilder = new InternalBuilder(); return internalBuilder.buildPropertyMapping(entity, runtimeFields); } - @Nullable - private org.springframework.data.elasticsearch.core.document.Document getRuntimeFields( + private org.springframework.data.elasticsearch.core.document.@Nullable Document getRuntimeFields( @Nullable ElasticsearchPersistentEntity entity) { if (entity != null) { @@ -161,7 +160,7 @@ private class InternalBuilder { private String nestedPropertyPrefix = ""; protected String buildPropertyMapping(ElasticsearchPersistentEntity entity, - @Nullable org.springframework.data.elasticsearch.core.document.Document runtimeFields) { + org.springframework.data.elasticsearch.core.document.@Nullable Document runtimeFields) { try { diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java index eeab36b2e..b4eab12af 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java @@ -23,8 +23,8 @@ import java.util.List; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.*; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java index 1576823b0..9463964ce 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutComponentTemplateRequest.java @@ -17,7 +17,7 @@ import java.time.Duration; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** @@ -26,6 +26,7 @@ */ public record PutComponentTemplateRequest(String name, @Nullable Long version, @Nullable Boolean create, @Nullable Duration masterTimeout, ComponentTemplateRequestData template) { + public PutComponentTemplateRequest { Assert.notNull(name, "name must not be null"); Assert.notNull(template, "template must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java index 1df627d35..0ef348f0e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutIndexTemplateRequest.java @@ -17,8 +17,8 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java index c18f5166c..20befc1e0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/PutTemplateRequest.java @@ -15,12 +15,12 @@ */ package org.springframework.data.elasticsearch.core.index; +import java.util.Map; + +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; -import java.util.Map; - /** * Request to create an index template. This is to create legacy templates (@see * https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html) diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java index 21bc2a170..87fc7a5c3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilder.java @@ -19,13 +19,13 @@ import reactor.core.publisher.Mono; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.Mapping; import org.springframework.data.elasticsearch.core.ReactiveResourceUtil; import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter; import org.springframework.data.elasticsearch.core.document.Document; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.mapping.MappingException; -import org.springframework.lang.Nullable; /** * Subclass of {@link MappingBuilder} with specialized methods To inhibit blocking calls diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java index 365a9118a..642d8dbbf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateData.java @@ -17,8 +17,8 @@ import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; /** * Data returned for template information retrieval. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java index 10f9f0dfb..9a3811804 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponse.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.index; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** @@ -23,6 +23,7 @@ * @since 5.1 */ public record TemplateResponse(String name, @Nullable Long version, @Nullable TemplateResponseData templateData) { + public TemplateResponse { Assert.notNull(name, "name must not be null"); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java index 7f6649e0e..ff1fc475c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/TemplateResponseData.java @@ -18,8 +18,8 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/index/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/index/package-info.java index 464fa781c..8317bc819 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/index/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/index/package-info.java @@ -1,6 +1,5 @@ /** * Classes related to Elasticsearch index management. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.index; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java b/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java index c6d589133..0cc4a44dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/join/JoinField.java @@ -17,8 +17,8 @@ import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.springframework.data.annotation.PersistenceCreator; -import org.springframework.lang.Nullable; /** * @author Subhobrata Dey diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java index 69905d964..7dc4d0125 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java @@ -17,8 +17,8 @@ import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java index 92cb90d53..cf5a24c63 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/CreateIndexSettings.java @@ -19,8 +19,8 @@ import java.util.Map; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java index 3fd5579fe..1cd45332b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java @@ -17,6 +17,7 @@ import java.util.Set; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Dynamic; import org.springframework.data.elasticsearch.annotations.Field; @@ -25,7 +26,6 @@ import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm; import org.springframework.data.mapping.PersistentEntity; import org.springframework.data.mapping.model.FieldNamingStrategy; -import org.springframework.lang.Nullable; /** * ElasticsearchPersistentEntity @@ -70,8 +70,7 @@ public interface ElasticsearchPersistentEntity extends PersistentEntity extends BasicPersistentEntit private @Nullable ElasticsearchPersistentProperty seqNoPrimaryTermProperty; private @Nullable ElasticsearchPersistentProperty joinFieldProperty; private @Nullable ElasticsearchPersistentProperty indexedIndexNameProperty; - private @Nullable Document.VersionType versionType; + private Document.@Nullable VersionType versionType; private final boolean createIndexAndMapping; private final boolean alwaysWriteMapping; private final Dynamic dynamic; @@ -176,9 +176,8 @@ public String getRefreshInterval() { return settingsParameter.get().refreshIntervall; } - @Nullable @Override - public Document.VersionType getVersionType() { + public Document.@Nullable VersionType getVersionType() { return versionType; } @@ -554,9 +553,9 @@ private static class SettingsParameter { @Nullable String refreshIntervall; @Nullable String indexStoreType; @Nullable private String[] sortFields; - @Nullable private Setting.SortOrder[] sortOrders; - @Nullable private Setting.SortMode[] sortModes; - @Nullable private Setting.SortMissing[] sortMissingValues; + private Setting.@Nullable SortOrder[] sortOrders; + private Setting.@Nullable SortMode[] sortModes; + private Setting.@Nullable SortMissing[] sortMissingValues; Settings toSettings() { diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java index b7c7835ad..85a1040dc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentProperty.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.springframework.beans.BeanUtils; import org.springframework.data.annotation.ReadOnlyProperty; import org.springframework.data.domain.Range; @@ -58,7 +59,6 @@ import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; import org.springframework.data.mapping.model.SimpleTypeHolder; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/mapping/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/mapping/package-info.java index 3c44ffb2c..d9e576366 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/mapping/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/mapping/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.mapping; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/package-info.java index 9c29d17f6..bc7d9b994 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java index a174511c4..1cb0190b0 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQuery.java @@ -27,9 +27,9 @@ import java.util.Optional; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java index b9c9acc62..540cfc6fa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BaseQueryBuilder.java @@ -23,9 +23,9 @@ import java.util.EnumSet; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -45,7 +45,7 @@ public abstract class BaseQueryBuilder ids = new ArrayList<>(); @Nullable private String route; - @Nullable private Query.SearchType searchType = Query.SearchType.QUERY_THEN_FETCH; + private Query.@Nullable SearchType searchType = Query.SearchType.QUERY_THEN_FETCH; @Nullable private IndicesOptions indicesOptions; private boolean trackScores; @Nullable private String preference; @@ -64,7 +64,7 @@ public abstract class BaseQueryBuilder idsWithRouting = new ArrayList<>(); private final List runtimeFields = new ArrayList<>(); - @Nullable private Query.PointInTime pointInTime; + private Query.@Nullable PointInTime pointInTime; @Nullable private Boolean allowNoIndices; private EnumSet expandWildcards = EnumSet.noneOf(IndicesOptions.WildcardStates.class); @@ -139,8 +139,7 @@ public List getIndicesBoost() { return indicesBoost; } - @Nullable - public Query.SearchType getSearchType() { + public Query.@Nullable SearchType getSearchType() { return searchType; } @@ -193,8 +192,8 @@ public List getRescorerQueries() { /** * @since 5.0 */ - @Nullable - public Query.PointInTime getPointInTime() { + + public Query.@Nullable PointInTime getPointInTime() { return pointInTime; } @@ -342,7 +341,7 @@ public SELF withIndicesBoost(IndexBoost... indicesBoost) { return self(); } - public SELF withSearchType(@Nullable Query.SearchType searchType) { + public SELF withSearchType(Query.@Nullable SearchType searchType) { this.searchType = searchType; return self(); } @@ -426,7 +425,7 @@ public SELF withRescorerQuery(RescorerQuery rescorerQuery) { /** * @since 5.0 */ - public SELF withPointInTime(@Nullable Query.PointInTime pointInTime) { + public SELF withPointInTime(Query.@Nullable PointInTime pointInTime) { this.pointInTime = pointInTime; return self(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java b/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java index 3c9ca4bc3..4e28b9d69 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java @@ -18,10 +18,10 @@ import java.time.Duration; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.ActiveShardCount; import org.springframework.data.elasticsearch.core.RefreshPolicy; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; -import org.springframework.lang.Nullable; /** * Options that may be passed to an diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java index 2f0236c85..334132ab9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java @@ -18,8 +18,8 @@ import java.util.Collections; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.ElasticsearchErrorCause; -import org.springframework.lang.Nullable; /** * Response of an update by query operation. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java index d398d7ee1..00a55116c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java @@ -24,6 +24,7 @@ import java.util.Set; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.elasticsearch.core.geo.GeoBox; import org.springframework.data.elasticsearch.core.geo.GeoJson; @@ -31,7 +32,6 @@ import org.springframework.data.geo.Box; import org.springframework.data.geo.Distance; import org.springframework.data.geo.Point; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java index d96fed8c7..40f75e60b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/DeleteQuery.java @@ -19,11 +19,11 @@ import java.util.EnumSet; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.core.query.Query.SearchType; import org.springframework.data.elasticsearch.core.query.types.ConflictsType; import org.springframework.data.elasticsearch.core.query.types.OperatorType; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java index 4ac86722f..d35af8b28 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/DocValueField.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java index ed3be0727..e6ffa17ed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilter.java @@ -17,7 +17,7 @@ import java.util.function.Function; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java index 689736511..cccb2a72b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/FetchSourceFilterBuilder.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * SourceFilter builder for providing includes and excludes. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java index 77c8ea45c..cbfc5ea4f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Field.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.query; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.lang.Nullable; /** * Defines a Field that can be used within a Criteria. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java index 5fe4d5a12..17ce512c4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HasChildQuery.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java index 0d8f9fb73..7e182c7e8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HasParentQuery.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java index 370afcd2c..5e8e2a5a7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/HighlightQuery.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.query; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.highlight.Highlight; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java index 38e358bca..cad53334a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQuery.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * IndexQuery diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java index 8cc67b286..6e4528043 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/IndexQueryBuilder.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.query; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.RefreshPolicy; -import org.springframework.lang.Nullable; /** * IndexQuery Builder @@ -36,7 +36,7 @@ public class IndexQueryBuilder { @Nullable private Long seqNo; @Nullable private Long primaryTerm; @Nullable private String routing; - @Nullable private IndexQuery.OpType opType; + private IndexQuery.@Nullable OpType opType; @Nullable private RefreshPolicy refreshPolicy; @Nullable private String indexName; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java index d4a92954d..5097e7217 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/InnerHitsQuery.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Defines an inner_hits request. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java index 57ce6ea34..421e25940 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/MoreLikeThisQuery.java @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Pageable; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java index a3eaad247..70044d2ed 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Order.java @@ -17,8 +17,8 @@ import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Sort; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java index 2a0dd17b7..ce3d445e1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/Query.java @@ -22,11 +22,11 @@ import java.util.List; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.core.SearchHit; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java index c35725d1e..96ce4a9f1 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/RescorerQuery.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.query; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java index 805883a5f..2f7afcdb6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/RuntimeField.java @@ -18,7 +18,7 @@ import java.util.HashMap; import java.util.Map; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java index 0bcb6ad20..1a81988cd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java @@ -18,7 +18,7 @@ import java.util.Map; import java.util.function.Function; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java index 4b4999fb0..804582c7b 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQuery.java @@ -17,7 +17,7 @@ import java.util.Map; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java index a0b61e27e..225933a67 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SearchTemplateQueryBuilder.java @@ -17,9 +17,9 @@ import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java index e94374365..298954cfa 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SimpleField.java @@ -15,12 +15,12 @@ */ package org.springframework.data.elasticsearch.core.query; +import java.util.Objects; + +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; -import java.util.Objects; - /** * The most trivial implementation of a Field. The {@link #name} is updatable, so it may be changed during query * preparation by the {@link org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter}. @@ -84,9 +84,12 @@ public String toString() { @Override public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof SimpleField that)) return false; - return Objects.equals(name, that.name) && Objects.equals(fieldType, that.fieldType) && Objects.equals(path, that.path); + if (this == o) + return true; + if (!(o instanceof SimpleField that)) + return false; + return Objects.equals(name, that.name) && Objects.equals(fieldType, that.fieldType) + && Objects.equals(path, that.path); } @Override diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java index 150cffb77..669661596 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SourceFilter.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.query; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.Field; -import org.springframework.lang.Nullable; /** * SourceFilter for providing includes and excludes. Using these helps in reducing the amount of data that is returned diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java index f14f1738e..332ba6962 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/SqlQuery.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.TimeZone; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java index 90f759749..087f0c105 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java @@ -18,9 +18,9 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.RefreshPolicy; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; /** * Defines an update request. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java index b8ae62201..d3b917adf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/HighlightCommonParameters.java @@ -15,8 +15,8 @@ */ package org.springframework.data.elasticsearch.core.query.highlight; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.query.Query; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java index b9a2dac3f..ddf7fd0e6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/highlight/package-info.java @@ -17,6 +17,5 @@ /** * classes to define highlight settings parameters of a query */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.query.highlight; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/query/package-info.java index 50b90a0ff..b75075744 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.query; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/types/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/query/types/package-info.java index a75996934..ecade8f8d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/types/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/types/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.query.types; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java index bf32e67ec..f7e83ce4d 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexRequest.java @@ -17,12 +17,12 @@ import java.time.Duration; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.query.IndexQuery; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.SourceFilter; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -216,8 +216,8 @@ public static class Dest { private final IndexCoordinates index; @Nullable private String pipeline; @Nullable private String routing; - @Nullable private Document.VersionType versionType; - @Nullable private IndexQuery.OpType opType; + private Document.@Nullable VersionType versionType; + private IndexQuery.@Nullable OpType opType; private Dest(IndexCoordinates index) { Assert.notNull(index, "dest index must not be null"); @@ -229,13 +229,11 @@ public IndexCoordinates getIndex() { return index; } - @Nullable - public Document.VersionType getVersionType() { + public Document.@Nullable VersionType getVersionType() { return versionType; } - @Nullable - public IndexQuery.OpType getOpType() { + public IndexQuery.@Nullable OpType getOpType() { return opType; } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java index 345a109f7..c65873041 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/ReindexResponse.java @@ -18,8 +18,8 @@ import java.util.Collections; import java.util.List; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.ElasticsearchErrorCause; -import org.springframework.lang.Nullable; /** * Response of reindex request. (@see diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java index 6454b67f2..f0f9a4a65 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/Remote.java @@ -17,7 +17,7 @@ import java.time.Duration; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/reindex/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/reindex/package-info.java index 2dfc0a174..aceb0f5bb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/reindex/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/reindex/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.reindex; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolver.java b/src/main/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolver.java index 1d84d00ab..799b5b963 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolver.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolver.java @@ -15,10 +15,10 @@ */ package org.springframework.data.elasticsearch.core.routing; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.mapping.context.MappingContext; -import org.springframework.lang.Nullable; /** * Default implementation of the {@link RoutingResolver} interface. Returns {@literal null} for the non-bean method and diff --git a/src/main/java/org/springframework/data/elasticsearch/core/routing/RoutingResolver.java b/src/main/java/org/springframework/data/elasticsearch/core/routing/RoutingResolver.java index 3e743afc6..fd0a4cac2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/routing/RoutingResolver.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/routing/RoutingResolver.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.routing; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/routing/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/routing/package-info.java index fee0db988..f32bab092 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/routing/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/routing/package-info.java @@ -1,6 +1,5 @@ /** * classes/interfaces for specification and implementation of Elasticsearch routing. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.routing; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java index b4c3d0372..8c4d507bb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.script; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; /** @@ -23,6 +23,7 @@ * @since 5.1 */ public record Script(String id, String language, String source) { + public Script { Assert.notNull(id, "id must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java b/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java index 8593293dc..e62ab034e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/ScriptOperations.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.script; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * This interfaces defines the operations to access the diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/script/package-info.java index 42c6e36c1..b16531f37 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/package-info.java @@ -1,6 +1,6 @@ /** - * Classes and interfaces to access to script API of Elasticsearch (https://www.elastic.co/guide/en/elasticsearch/reference/8.5/script-apis.html). + * Classes and interfaces to access to script API of Elasticsearch + * (https://www.elastic.co/guide/en/elasticsearch/reference/8.5/script-apis.html). */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.script; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java index 0ddc78abc..74db4c728 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/SqlResponse.java @@ -25,8 +25,8 @@ import java.util.List; import java.util.Map; -import org.springframework.lang.NonNull; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; /** * Defines an SQL response. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java index 306bceade..b1af98166 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/sql/package-info.java @@ -1,6 +1,5 @@ /** * Classes and interfaces to access to SQL API of Elasticsearch. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.sql; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java index 88be836b3..32e99b3bb 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/Completion.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Based on the reference doc - diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java index 47463fc6a..622c4bd0e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/package-info.java @@ -13,6 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.suggest; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java index 94d93c80d..b6aa8fa9c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/CompletionSuggestion.java @@ -20,10 +20,10 @@ import java.util.Set; import java.util.function.BiFunction; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.document.SearchDocument; import org.springframework.data.elasticsearch.support.ScoreDoc; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java index ad50678d9..a96a9a463 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/PhraseSuggestion.java @@ -15,10 +15,10 @@ */ package org.springframework.data.elasticsearch.core.suggest.response; -import org.springframework.lang.Nullable; - import java.util.List; +import org.jspecify.annotations.Nullable; + /** * @author Peter-Josef Meisch * @since 4.3 diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java index 862d0ed44..958e1bb8c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/Suggest.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * Class structure mirroring the Elasticsearch classes for a suggest response. diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java index 2e42bc00b..4e6183a39 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/TermSuggestion.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.core.suggest.response; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/package-info.java b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/package-info.java index 5d02fba12..7507d78a2 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/suggest/response/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.suggest.response; diff --git a/src/main/java/org/springframework/data/elasticsearch/package-info.java b/src/main/java/org/springframework/data/elasticsearch/package-info.java index c90fb3237..69b12af1f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java index 44331d72e..781d7c3a3 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ElasticsearchRepository.java @@ -15,13 +15,13 @@ */ package org.springframework.data.elasticsearch.repository; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.core.RefreshPolicy; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.PagingAndSortingRepository; -import org.springframework.lang.Nullable; /** * @param diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java index 59ee81f30..9ab2a3108 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/ReactiveElasticsearchRepository.java @@ -18,12 +18,12 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.jspecify.annotations.Nullable; import org.reactivestreams.Publisher; import org.springframework.data.elasticsearch.core.RefreshPolicy; import org.springframework.data.repository.NoRepositoryBean; import org.springframework.data.repository.reactive.ReactiveCrudRepository; import org.springframework.data.repository.reactive.ReactiveSortingRepository; -import org.springframework.lang.Nullable; /** * Elasticsearch specific {@link org.springframework.data.repository.Repository} interface with reactive support. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java b/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java index b86a7137c..719905721 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/aot/RepositoryRuntimeHints.java @@ -19,11 +19,11 @@ import java.util.Arrays; +import org.jspecify.annotations.Nullable; import org.springframework.aot.hint.MemberCategory; import org.springframework.aot.hint.RuntimeHints; import org.springframework.aot.hint.RuntimeHintsRegistrar; import org.springframework.aot.hint.TypeReference; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/aot/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/aot/package-info.java index 1a7c898aa..270425b63 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/aot/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/aot/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.aot; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/package-info.java index f11afc98b..b307ca973 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/cdi/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/cdi/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.cdi; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/config/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/config/package-info.java index 9f8e26676..2278b3f14 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/config/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/config/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.config; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/package-info.java index 9d9e57ab2..14c68bac4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/package-info.java @@ -1,5 +1,5 @@ /** * infrastructure to define the Elasticsearch mapping for an index. */ -@org.springframework.lang.NonNullApi +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java index aa4f84e08..fae3b1992 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractElasticsearchRepositoryQuery.java @@ -15,6 +15,7 @@ */ package org.springframework.data.elasticsearch.repository.query; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.PageRequest; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.SearchHitSupport; @@ -31,7 +32,6 @@ import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ResultProcessor; import org.springframework.data.util.StreamUtils; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java index 7b149141e..1d7252286 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/AbstractReactiveElasticsearchRepositoryQuery.java @@ -15,7 +15,6 @@ */ package org.springframework.data.elasticsearch.repository.query; -import org.springframework.data.expression.ValueEvaluationContextProvider; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -33,6 +32,7 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryExecution.ResultProcessingConverter; import org.springframework.data.elasticsearch.repository.query.ReactiveElasticsearchQueryExecution.ResultProcessingExecution; +import org.springframework.data.expression.ValueEvaluationContextProvider; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.query.ParameterAccessor; import org.springframework.data.repository.query.QueryMethod; @@ -56,7 +56,7 @@ abstract class AbstractReactiveElasticsearchRepositoryQuery implements Repositor AbstractReactiveElasticsearchRepositoryQuery(ReactiveElasticsearchQueryMethod queryMethod, ReactiveElasticsearchOperations elasticsearchOperations, - ValueEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { Assert.notNull(queryMethod, "queryMethod must not be null"); Assert.notNull(elasticsearchOperations, "elasticsearchOperations must not be null"); @@ -105,7 +105,8 @@ private Object execute(ElasticsearchParametersParameterAccessor parameterAccesso var query = createQuery(parameterAccessor); Assert.notNull(query, "unsupported query"); - queryMethod.addSpecialMethodParameters(query, parameterAccessor, elasticsearchOperations.getElasticsearchConverter(), + queryMethod.addSpecialMethodParameters(query, parameterAccessor, + elasticsearchOperations.getElasticsearchConverter(), evaluationContextProvider); String indexName = queryMethod.getEntityInformation().getIndexName(); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java index e6d995846..2ff4bc236 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethod.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.stream.Stream; +import org.jspecify.annotations.Nullable; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.convert.ConversionService; import org.springframework.dao.InvalidDataAccessApiUsageException; @@ -54,7 +55,6 @@ import org.springframework.data.repository.util.QueryExecutionConverters; import org.springframework.data.repository.util.ReactiveWrapperConverters; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -399,8 +399,8 @@ private Class potentiallyUnwrapReturnTypeFor(RepositoryMetadata metadata, Met } void addSpecialMethodParameters(BaseQuery query, ElasticsearchParametersParameterAccessor parameterAccessor, - ElasticsearchConverter elasticsearchConverter, - ValueEvaluationContextProvider evaluationContextProvider) { + ElasticsearchConverter elasticsearchConverter, + ValueEvaluationContextProvider evaluationContextProvider) { if (hasAnnotatedHighlight()) { var highlightQuery = getAnnotatedHighlightQuery(new HighlightConverter(parameterAccessor, diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java index d66a0087e..c166e7edd 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryExecution.java @@ -15,12 +15,12 @@ */ package org.springframework.data.elasticsearch.repository.query; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.converter.Converter; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.repository.query.ResultProcessor; import org.springframework.data.repository.query.ReturnedType; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/package-info.java index 0db3509f2..e903d1ffe 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.query; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java index e681d018d..5c1456796 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/ElasticsearchQueryCreator.java @@ -15,6 +15,10 @@ */ package org.springframework.data.elasticsearch.repository.query.parser; +import java.util.Collection; +import java.util.Iterator; + +import org.jspecify.annotations.Nullable; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.domain.Sort; import org.springframework.data.elasticsearch.core.geo.GeoBox; @@ -31,10 +35,6 @@ import org.springframework.data.repository.query.parser.AbstractQueryCreator; import org.springframework.data.repository.query.parser.Part; import org.springframework.data.repository.query.parser.PartTree; -import org.springframework.lang.Nullable; - -import java.util.Collection; -import java.util.Iterator; /** * ElasticsearchQueryCreator @@ -48,159 +48,159 @@ */ public class ElasticsearchQueryCreator extends AbstractQueryCreator { - private final MappingContext context; - - public ElasticsearchQueryCreator(PartTree tree, ParameterAccessor parameters, - MappingContext context) { - super(tree, parameters); - this.context = context; - } - - public ElasticsearchQueryCreator(PartTree tree, MappingContext context) { - super(tree); - this.context = context; - } - - @Override - protected CriteriaQuery create(Part part, Iterator iterator) { - PersistentPropertyPath path = context.getPersistentPropertyPath( - part.getProperty()); - return new CriteriaQuery(from(part, - new Criteria(path.toDotPath(ElasticsearchPersistentProperty.QueryPropertyToFieldNameConverter.INSTANCE)), - iterator)); - } - - @Override - protected CriteriaQuery and(Part part, CriteriaQuery base, Iterator iterator) { - if (base == null) { - return create(part, iterator); - } - PersistentPropertyPath path = context.getPersistentPropertyPath( - part.getProperty()); - return base.addCriteria(from(part, - new Criteria(path.toDotPath(ElasticsearchPersistentProperty.QueryPropertyToFieldNameConverter.INSTANCE)), - iterator)); - } - - @Override - protected CriteriaQuery or(CriteriaQuery base, CriteriaQuery query) { - return new CriteriaQuery(base.getCriteria().or(query.getCriteria())); - } - - @Override - protected CriteriaQuery complete(@Nullable CriteriaQuery query, Sort sort) { - - if (query == null) { - // this is the case in a findAllByOrderByField method, add empty criteria - query = new CriteriaQuery(new Criteria()); - } - return query.addSort(sort); - } - - private Criteria from(Part part, Criteria criteria, Iterator parameters) { - - Part.Type type = part.getType(); - - return switch (type) { - case TRUE -> criteria.is(true); - case FALSE -> criteria.is(false); - case NEGATING_SIMPLE_PROPERTY -> criteria.is(parameters.next()).not(); - case REGEX -> criteria.expression(parameters.next().toString()); - case LIKE, STARTING_WITH -> criteria.startsWith(parameters.next().toString()); - case ENDING_WITH -> criteria.endsWith(parameters.next().toString()); - case CONTAINING -> criteria.contains(parameters.next().toString()); - case GREATER_THAN -> criteria.greaterThan(parameters.next()); - case AFTER, GREATER_THAN_EQUAL -> criteria.greaterThanEqual(parameters.next()); - case LESS_THAN -> criteria.lessThan(parameters.next()); - case BEFORE, LESS_THAN_EQUAL -> criteria.lessThanEqual(parameters.next()); - case BETWEEN -> criteria.between(parameters.next(), parameters.next()); - case IN -> criteria.in(asArray(parameters.next())); - case NOT_IN -> criteria.notIn(asArray(parameters.next())); - case SIMPLE_PROPERTY, WITHIN -> within(part, criteria, parameters); - case NEAR -> near(criteria, parameters); - case EXISTS, IS_NOT_NULL -> criteria.exists(); - case IS_NULL -> criteria.not().exists(); - case IS_EMPTY -> criteria.empty(); - case IS_NOT_EMPTY -> criteria.notEmpty(); - default -> throw new InvalidDataAccessApiUsageException("Illegal criteria found '" + type + "'."); - }; - } - - private Criteria within(Part part, Criteria criteria, Iterator parameters) { - - Object firstParameter = parameters.next(); - Object secondParameter; - - if (part.getType() == Part.Type.SIMPLE_PROPERTY) { - if (part.getProperty().getType() != GeoPoint.class) { - if (firstParameter != null) { - return criteria.is(firstParameter); - } else { - // searching for null is a must_not (exists) - return criteria.exists().not(); - } - } else { - // it means it's a simple find with exact geopoint matching (e.g. findByLocation) - // and because Elasticsearch does not have any kind of query with just a geopoint - // as argument we use a "geo distance" query with a distance of one meter. - secondParameter = ".001km"; - } - } else { - secondParameter = parameters.next(); - } - - return doWithinIfPossible(criteria, firstParameter, secondParameter); - } - - private Criteria near(Criteria criteria, Iterator parameters) { - - Object firstParameter = parameters.next(); - - if (firstParameter instanceof GeoBox geoBox) { - return criteria.boundedBy(geoBox); - } - - if (firstParameter instanceof Box box) { - return criteria.boundedBy(GeoBox.fromBox(box)); - } - - Object secondParameter = parameters.next(); - - return doWithinIfPossible(criteria, firstParameter, secondParameter); - } - - /** - * Do a within query if possible, otherwise return the criteria unchanged. - * - * @param criteria must not be {@literal null} - * @param firstParameter must not be {@literal null} - * @param secondParameter must not be {@literal null} - * @return the criteria with the within query applied if possible. - * @author Junghoon Ban - */ - private Criteria doWithinIfPossible(Criteria criteria, Object firstParameter, Object secondParameter) { - - if (firstParameter instanceof GeoPoint geoPoint && secondParameter instanceof String string) { - return criteria.within(geoPoint, string); - } - - if (firstParameter instanceof Point point && secondParameter instanceof Distance distance) { - return criteria.within(point, distance); - } - - if (firstParameter instanceof String firstString && secondParameter instanceof String secondString) { - return criteria.within(firstString, secondString); - } - - return criteria; - } - - private Object[] asArray(Object o) { - if (o instanceof Collection) { - return ((Collection) o).toArray(); - } else if (o.getClass().isArray()) { - return (Object[]) o; - } - return new Object[]{o}; - } + private final MappingContext context; + + public ElasticsearchQueryCreator(PartTree tree, ParameterAccessor parameters, + MappingContext context) { + super(tree, parameters); + this.context = context; + } + + public ElasticsearchQueryCreator(PartTree tree, MappingContext context) { + super(tree); + this.context = context; + } + + @Override + protected CriteriaQuery create(Part part, Iterator iterator) { + PersistentPropertyPath path = context.getPersistentPropertyPath( + part.getProperty()); + return new CriteriaQuery(from(part, + new Criteria(path.toDotPath(ElasticsearchPersistentProperty.QueryPropertyToFieldNameConverter.INSTANCE)), + iterator)); + } + + @Override + protected CriteriaQuery and(Part part, CriteriaQuery base, Iterator iterator) { + if (base == null) { + return create(part, iterator); + } + PersistentPropertyPath path = context.getPersistentPropertyPath( + part.getProperty()); + return base.addCriteria(from(part, + new Criteria(path.toDotPath(ElasticsearchPersistentProperty.QueryPropertyToFieldNameConverter.INSTANCE)), + iterator)); + } + + @Override + protected CriteriaQuery or(CriteriaQuery base, CriteriaQuery query) { + return new CriteriaQuery(base.getCriteria().or(query.getCriteria())); + } + + @Override + protected CriteriaQuery complete(@Nullable CriteriaQuery query, Sort sort) { + + if (query == null) { + // this is the case in a findAllByOrderByField method, add empty criteria + query = new CriteriaQuery(new Criteria()); + } + return query.addSort(sort); + } + + private Criteria from(Part part, Criteria criteria, Iterator parameters) { + + Part.Type type = part.getType(); + + return switch (type) { + case TRUE -> criteria.is(true); + case FALSE -> criteria.is(false); + case NEGATING_SIMPLE_PROPERTY -> criteria.is(parameters.next()).not(); + case REGEX -> criteria.expression(parameters.next().toString()); + case LIKE, STARTING_WITH -> criteria.startsWith(parameters.next().toString()); + case ENDING_WITH -> criteria.endsWith(parameters.next().toString()); + case CONTAINING -> criteria.contains(parameters.next().toString()); + case GREATER_THAN -> criteria.greaterThan(parameters.next()); + case AFTER, GREATER_THAN_EQUAL -> criteria.greaterThanEqual(parameters.next()); + case LESS_THAN -> criteria.lessThan(parameters.next()); + case BEFORE, LESS_THAN_EQUAL -> criteria.lessThanEqual(parameters.next()); + case BETWEEN -> criteria.between(parameters.next(), parameters.next()); + case IN -> criteria.in(asArray(parameters.next())); + case NOT_IN -> criteria.notIn(asArray(parameters.next())); + case SIMPLE_PROPERTY, WITHIN -> within(part, criteria, parameters); + case NEAR -> near(criteria, parameters); + case EXISTS, IS_NOT_NULL -> criteria.exists(); + case IS_NULL -> criteria.not().exists(); + case IS_EMPTY -> criteria.empty(); + case IS_NOT_EMPTY -> criteria.notEmpty(); + default -> throw new InvalidDataAccessApiUsageException("Illegal criteria found '" + type + "'."); + }; + } + + private Criteria within(Part part, Criteria criteria, Iterator parameters) { + + Object firstParameter = parameters.next(); + Object secondParameter; + + if (part.getType() == Part.Type.SIMPLE_PROPERTY) { + if (part.getProperty().getType() != GeoPoint.class) { + if (firstParameter != null) { + return criteria.is(firstParameter); + } else { + // searching for null is a must_not (exists) + return criteria.exists().not(); + } + } else { + // it means it's a simple find with exact geopoint matching (e.g. findByLocation) + // and because Elasticsearch does not have any kind of query with just a geopoint + // as argument we use a "geo distance" query with a distance of one meter. + secondParameter = ".001km"; + } + } else { + secondParameter = parameters.next(); + } + + return doWithinIfPossible(criteria, firstParameter, secondParameter); + } + + private Criteria near(Criteria criteria, Iterator parameters) { + + Object firstParameter = parameters.next(); + + if (firstParameter instanceof GeoBox geoBox) { + return criteria.boundedBy(geoBox); + } + + if (firstParameter instanceof Box box) { + return criteria.boundedBy(GeoBox.fromBox(box)); + } + + Object secondParameter = parameters.next(); + + return doWithinIfPossible(criteria, firstParameter, secondParameter); + } + + /** + * Do a within query if possible, otherwise return the criteria unchanged. + * + * @param criteria must not be {@literal null} + * @param firstParameter must not be {@literal null} + * @param secondParameter must not be {@literal null} + * @return the criteria with the within query applied if possible. + * @author Junghoon Ban + */ + private Criteria doWithinIfPossible(Criteria criteria, Object firstParameter, Object secondParameter) { + + if (firstParameter instanceof GeoPoint geoPoint && secondParameter instanceof String string) { + return criteria.within(geoPoint, string); + } + + if (firstParameter instanceof Point point && secondParameter instanceof Distance distance) { + return criteria.within(point, distance); + } + + if (firstParameter instanceof String firstString && secondParameter instanceof String secondString) { + return criteria.within(firstString, secondString); + } + + return criteria; + } + + private Object[] asArray(Object o) { + if (o instanceof Collection) { + return ((Collection) o).toArray(); + } else if (o.getClass().isArray()) { + return (Object[]) o; + } + return new Object[] { o }; + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/package-info.java index 1654f41ae..5f524c1b8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/query/parser/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.query.parser; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java index 6e71c428c..1320b979f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchEntityInformation.java @@ -15,10 +15,10 @@ */ package org.springframework.data.elasticsearch.repository.support; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.repository.core.EntityInformation; -import org.springframework.lang.Nullable; /** * @param @@ -39,6 +39,5 @@ public interface ElasticsearchEntityInformation extends EntityInformation @Nullable Long getVersion(T entity); - @Nullable - Document.VersionType getVersionType(); + Document.@Nullable VersionType getVersionType(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java index 0d899bbed..b5d0b1270 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactory.java @@ -20,6 +20,7 @@ import java.lang.reflect.Method; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod; @@ -40,7 +41,6 @@ import org.springframework.data.repository.query.QueryLookupStrategy.Key; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java index e331fa60e..98cf29d0f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryFactoryBean.java @@ -17,11 +17,11 @@ import java.io.Serializable; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.repository.Repository; import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport; import org.springframework.data.repository.core.support.RepositoryFactorySupport; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java index a32b503b0..b24cc1762 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/QueryStringProcessor.java @@ -37,7 +37,7 @@ public class QueryStringProcessor { private final ValueEvaluationContextProvider evaluationContextProvider; public QueryStringProcessor(String query, QueryMethod queryMethod, ConversionService conversionService, - ValueEvaluationContextProvider evaluationContextProvider) { + ValueEvaluationContextProvider evaluationContextProvider) { Assert.notNull(query, "query must not be null"); Assert.notNull(queryMethod, "queryMethod must not be null"); diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java index 7e2607e6e..368df504c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactory.java @@ -19,6 +19,7 @@ import java.lang.reflect.Method; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; @@ -40,7 +41,6 @@ import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor; import org.springframework.data.repository.query.RepositoryQuery; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java index b58bb3999..3f30545bf 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/ReactiveElasticsearchRepositoryFactoryBean.java @@ -15,12 +15,12 @@ */ package org.springframework.data.elasticsearch.repository.support; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.repository.Repository; import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport; import org.springframework.data.repository.core.support.RepositoryFactorySupport; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java index 54a0928cc..d48a3c80e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleElasticsearchRepository.java @@ -22,6 +22,7 @@ import java.util.stream.Collectors; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; @@ -45,7 +46,6 @@ import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.util.StreamUtils; import org.springframework.data.util.Streamable; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -457,7 +457,7 @@ public R executeAndRefresh(OperationsCallback callback) { @Nullable public R executeAndRefresh(OperationsCallback callback, @Nullable RefreshPolicy refreshPolicy) { - return callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); + return callback.doWithOperations(operations.withRefreshPolicy(refreshPolicy)); } // endregion } diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java index 1d9c116cf..ae3e1a4d0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepository.java @@ -20,6 +20,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import org.jspecify.annotations.Nullable; import org.reactivestreams.Publisher; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.routing.RoutingResolver; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/package-info.java index 17be692af..7f6a0f13f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.support; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java index cd3eefa92..432d1883e 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ExampleCriteriaMapper.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.springframework.dao.InvalidDataAccessApiUsageException; import org.springframework.data.domain.Example; import org.springframework.data.domain.ExampleMatcher; @@ -27,7 +28,6 @@ import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.support.ExampleMatcherAccessor; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/package-info.java index aea4322e9..c2b3be5cc 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/querybyexample/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.support.querybyexample; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java index e40fa11dc..9d982d928 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/QueryStringSpELEvaluator.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.ConversionService; import org.springframework.data.elasticsearch.core.convert.ConversionException; import org.springframework.data.elasticsearch.repository.query.ElasticsearchParametersParameterAccessor; @@ -36,7 +37,6 @@ import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.expression.spel.support.StandardTypeConverter; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/package-info.java index 1d76d236d..0388eba7c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/spel/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.support.spel; diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java index 706e11de2..2e3441fd0 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchCollectionValueToStringConverter.java @@ -21,10 +21,10 @@ import java.util.Set; import java.util.StringJoiner; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.GenericConverter; -import org.springframework.lang.Nullable; /** * Convert a collection into string for value part of the elasticsearch query. diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java index 67540ee1f..a611311c6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchQueryValueConversionService.java @@ -18,11 +18,11 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.Converter; import org.springframework.core.convert.support.GenericConversionService; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java index 23b4a75de..ee03ccf3f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/ElasticsearchStringValueToStringConverter.java @@ -19,9 +19,9 @@ import java.util.Set; import java.util.regex.Matcher; +import org.jspecify.annotations.Nullable; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.GenericConverter; -import org.springframework.lang.Nullable; /** * Values in elasticsearch query may contain quotations and should be escaped when converting. Note that the converter diff --git a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/package-info.java b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/package-info.java index 89f2436e2..18e794112 100644 --- a/src/main/java/org/springframework/data/elasticsearch/repository/support/value/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/repository/support/value/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repository.support.value; diff --git a/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java b/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java index a27aa036c..f171d8604 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/DefaultStringObjectMap.java @@ -22,7 +22,7 @@ import java.util.Set; import java.util.function.BiConsumer; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java b/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java index 464b7253e..742ce9d04 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/HttpHeaders.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Set; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; import org.springframework.util.LinkedCaseInsensitiveMap; import org.springframework.util.MultiValueMap; diff --git a/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java b/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java index c5079133f..4de876f8a 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/ScoreDoc.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.support; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java b/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java index 0cb286c7d..f3a7c86c9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/StringObjectMap.java @@ -21,8 +21,8 @@ import java.util.function.LongSupplier; import java.util.function.Supplier; +import org.jspecify.annotations.Nullable; import org.springframework.data.elasticsearch.core.document.Document; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** diff --git a/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java b/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java index f9f85b6aa..d62ea73f8 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/VersionInfo.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * This class is used to log the versions of Spring Data Elasticsearch, the Elasticsearch client libs used to built, the diff --git a/src/main/java/org/springframework/data/elasticsearch/support/package-info.java b/src/main/java/org/springframework/data/elasticsearch/support/package-info.java index 0ad015c73..7c65e45ba 100644 --- a/src/main/java/org/springframework/data/elasticsearch/support/package-info.java +++ b/src/main/java/org/springframework/data/elasticsearch/support/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.support; diff --git a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java index 991324cc8..268227455 100644 --- a/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java @@ -29,6 +29,7 @@ import java.util.Map; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -49,7 +50,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees diff --git a/src/test/java/org/springframework/data/elasticsearch/NullabilityArchitectureTests.java b/src/test/java/org/springframework/data/elasticsearch/NullabilityArchitectureTests.java new file mode 100644 index 000000000..a086f251e --- /dev/null +++ b/src/test/java/org/springframework/data/elasticsearch/NullabilityArchitectureTests.java @@ -0,0 +1,21 @@ +package org.springframework.data.elasticsearch; + +import com.tngtech.archunit.junit.AnalyzeClasses; +import com.tngtech.archunit.junit.ArchTest; +import com.tngtech.archunit.lang.ArchRule; +import com.tngtech.archunit.lang.syntax.ArchRuleDefinition; + +@AnalyzeClasses(packages = { "org.springframework.data.elasticsearch" }) +class NullabilityArchitectureTests { + + @ArchTest public static final ArchRule shouldNotUseSpringNullability = ArchRuleDefinition + .noClasses() + .that() + .resideInAPackage("org.springframework.data.elasticsearch..") + .should() + .dependOnClassesThat() + .haveFullyQualifiedName("org.springframework.lang.NonNull") + .orShould() + .dependOnClassesThat() + .haveFullyQualifiedName("org.springframework.lang.Nullable"); +} diff --git a/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java b/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java index e376c0beb..8c64053a8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/annotations/ComposableAnnotationsUnitTest.java @@ -28,6 +28,7 @@ import java.time.LocalDate; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.core.annotation.AliasFor; @@ -39,7 +40,6 @@ import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.suggest.Completion; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java index e53a33df6..c0f3641db 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java @@ -30,6 +30,7 @@ import org.assertj.core.api.SoftAssertions; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -49,7 +50,6 @@ import org.springframework.data.elasticsearch.core.query.FetchSourceFilterBuilder; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.SourceFilter; -import org.springframework.lang.Nullable; /** * Tests for the mapping of {@link CriteriaQuery} by a {@link MappingElasticsearchConverter}. In the same package as diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java index d80e08ce9..25308b569 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/DevTests.java @@ -48,6 +48,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.elasticsearch.client.RequestOptions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Order; @@ -57,7 +58,6 @@ import org.springframework.data.elasticsearch.core.convert.MappingElasticsearchConverter; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.support.HttpHeaders; -import org.springframework.lang.Nullable; /** * Not really tests, but a class to check the first implementations of the new Elasticsearch client. Needs Elasticsearch diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java index 4e6c09230..875fd752e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/ELCWiremockTests.java @@ -18,6 +18,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -29,13 +30,13 @@ import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.client.ClientConfiguration; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.lang.Nullable; import org.springframework.test.context.junit.jupiter.SpringExtension; import com.github.tomakehurst.wiremock.junit5.WireMockExtension; /** * Tests that need to check the data produced by the Elasticsearch client + * * @author Peter-Josef Meisch */ @SuppressWarnings("UastIncorrectHttpHeaderInspection") diff --git a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java index a789eb4ad..cdb597e38 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/elc/RequestConverterTest.java @@ -21,6 +21,7 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -35,7 +36,6 @@ 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.lang.Nullable; /** * @author Peter-Josef Meisch @@ -83,8 +83,8 @@ void refreshSetByDeleteRequest() { var deleteQuery = DeleteQuery.builder(query).withRefresh(true).build(); var deleteByQueryRequest = requestConverter.documentDeleteByQueryRequest(deleteQuery, null, SampleEntity.class, - IndexCoordinates.of("foo"), - null); + IndexCoordinates.of("foo"), + null); assertThat(deleteByQueryRequest.refresh()).isTrue(); } diff --git a/src/test/java/org/springframework/data/elasticsearch/client/util/package-info.java b/src/test/java/org/springframework/data/elasticsearch/client/util/package-info.java index 79701328c..3e0be8092 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/util/package-info.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/util/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.client.util; diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java index 4ee583aaa..eb2785108 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingIntegrationTests.java @@ -20,6 +20,7 @@ import java.time.LocalDateTime; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.mapping.callback.EntityCallbacks; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java index 2dfaee370..84a308166 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/AuditingReactiveIntegrationTest.java @@ -21,6 +21,7 @@ import java.time.LocalDateTime; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.mapping.callback.ReactiveEntityCallbacks; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java index 489daba24..973f129b3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ElasticsearchConfigurationELCTests.java @@ -20,6 +20,7 @@ import co.elastic.clients.elasticsearch.ElasticsearchClient; import org.elasticsearch.client.RestClient; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -31,7 +32,6 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; diff --git a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java index a01485c99..77b290eec 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/configuration/ReactiveElasticsearchConfigurationELCTests.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.repository.config.EnableReactiveElasticsearchRepositories; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; diff --git a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java index de50ad46e..76bf50ccf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/nested/EnableNestedRepositoriesIntegrationTests.java @@ -18,9 +18,7 @@ import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; -import java.lang.Double; -import java.lang.Long; - +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -36,7 +34,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.Repository; -import org.springframework.lang.Nullable; /** * @author Kevin Leturc diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java index a40aa5eaa..8222e2ef8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/EnableRepositoriesIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.UUID; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -40,7 +41,6 @@ import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.Repository; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees @@ -158,12 +158,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Double getScriptedRate() { + public java.lang.@Nullable Double getScriptedRate() { return scriptedRate; } - public void setScriptedRate(@Nullable java.lang.Double scriptedRate) { + public void setScriptedRate(java.lang.@Nullable Double scriptedRate) { this.scriptedRate = scriptedRate; } @@ -193,12 +192,11 @@ public void setLocation(@Nullable GeoPoint location) { this.location = location; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -254,12 +252,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Long getScriptedRate() { + public java.lang.@Nullable Long getScriptedRate() { return scriptedRate; } - public void setScriptedRate(@Nullable java.lang.Long scriptedRate) { + public void setScriptedRate(java.lang.@Nullable Long scriptedRate) { this.scriptedRate = scriptedRate; } @@ -289,12 +286,11 @@ public void setLocation(@Nullable GeoPoint location) { this.location = location; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/config/notnested/package-info.java b/src/test/java/org/springframework/data/elasticsearch/config/notnested/package-info.java index 55d936ed9..c32f6a26e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/config/notnested/package-info.java +++ b/src/test/java/org/springframework/data/elasticsearch/config/notnested/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.config.notnested; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java index a88a36dbb..884fde8d9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Bean; @@ -49,7 +50,6 @@ import org.springframework.data.elasticsearch.core.query.ScriptedField; import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java index 98449b4cc..3a2e89212 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java @@ -24,13 +24,13 @@ import static org.springframework.data.elasticsearch.utils.IdGenerator.*; import static org.springframework.data.elasticsearch.utils.IndexBuilder.*; -import java.time.Duration; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.assertj.core.api.InstanceOfAssertFactories; import org.assertj.core.api.SoftAssertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -67,7 +67,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.util.StreamUtils; -import org.springframework.lang.Nullable; /** * All the integration tests that are not in separate files. @@ -4004,12 +4003,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Double getScriptedRate() { + public java.lang.@Nullable Double getScriptedRate() { return scriptedRate; } - public void setScriptedRate(@Nullable java.lang.Double scriptedRate) { + public void setScriptedRate(java.lang.@Nullable Double scriptedRate) { this.scriptedRate = scriptedRate; } @@ -4030,12 +4028,11 @@ public void setLocation(@Nullable GeoPoint location) { this.location = location; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } @@ -4164,12 +4161,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Long getScriptedRate() { + public java.lang.@Nullable Long getScriptedRate() { return scriptedRate; } - public void setScriptedRate(@Nullable java.lang.Long scriptedRate) { + public void setScriptedRate(java.lang.@Nullable Long scriptedRate) { this.scriptedRate = scriptedRate; } @@ -4190,12 +4186,11 @@ public void setLocation(@Nullable GeoPoint location) { this.location = location; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -4341,12 +4336,11 @@ private static class GTEVersionEntity { @Id private String id; @Nullable private String name; - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } @@ -4401,12 +4395,11 @@ public void setFirstName(@Nullable String firstName) { this.firstName = firstName; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -4444,12 +4437,11 @@ public void setLastName(@Nullable String lastName) { this.lastName = lastName; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -4534,7 +4526,7 @@ static class SearchHitsEntity { public SearchHitsEntity() {} - public SearchHitsEntity(@Nullable String id, @Nullable java.lang.Long number, @Nullable String keyword) { + public SearchHitsEntity(@Nullable String id, java.lang.@Nullable Long number, @Nullable String keyword) { this.id = id; this.number = number; this.keyword = keyword; @@ -4549,12 +4541,11 @@ public void setId(@Nullable String id) { this.id = id; } - @Nullable - public java.lang.Long getNumber() { + public java.lang.@Nullable Long getNumber() { return number; } - public void setNumber(@Nullable java.lang.Long number) { + public void setNumber(java.lang.@Nullable Long number) { this.number = number; } @@ -4669,12 +4660,11 @@ public void setSeqNoPrimaryTerm(@Nullable SeqNoPrimaryTerm seqNoPrimaryTerm) { this.seqNoPrimaryTerm = seqNoPrimaryTerm; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -4688,7 +4678,7 @@ static class VersionedEntity { public VersionedEntity() {} - public VersionedEntity(@Nullable String id, @Nullable java.lang.Long version) { + public VersionedEntity(@Nullable String id, java.lang.@Nullable Long version) { this.id = id; this.version = version; } @@ -4702,12 +4692,11 @@ public void setId(@Nullable String id) { this.id = id; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -4825,7 +4814,7 @@ public static final class ImmutableWithScriptedEntity { @Nullable @ScriptedField private final Double scriptedRate; - public ImmutableWithScriptedEntity(String id, int rate, @Nullable java.lang.Double scriptedRate) { + public ImmutableWithScriptedEntity(String id, int rate, java.lang.@Nullable Double scriptedRate) { this.id = id; this.rate = rate; this.scriptedRate = scriptedRate; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/EntityOperationsUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/EntityOperationsUnitTests.java index c7ada87d8..c85621b8b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/EntityOperationsUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/EntityOperationsUnitTests.java @@ -21,6 +21,7 @@ import java.util.HashSet; import org.assertj.core.api.SoftAssertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -39,7 +40,6 @@ import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm; import org.springframework.data.elasticsearch.core.routing.DefaultRoutingResolver; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java index 1f50ee60f..6dcb12cb7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/InnerHitsIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.List; import org.assertj.core.api.SoftAssertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Testing the querying and parsing of inner_hits. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java index c189c6863..c7c7c463c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/LogEntityIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.Arrays; import java.util.Date; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * LogEntityIntegrationTests @@ -137,8 +137,7 @@ static class LogEntity { @Nullable private long sequenceCode; @Nullable @Field(type = Ip) private String ip; - @Nullable - @Field(type = Date, format = DateFormat.date_time) private java.util.Date date; + @Field(type = Date, format = DateFormat.date_time) private java.util.@Nullable Date date; private LogEntity() {} diff --git a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java index 63ec4fec9..4f640f843 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/PointInTimeIntegrationTests.java @@ -19,6 +19,7 @@ import java.time.Duration; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java index f6ead65ff..4e465de68 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchELCIntegrationTests.java @@ -28,6 +28,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.Bean; @@ -42,7 +43,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java index e39131dfa..7090ea507 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchIntegrationTests.java @@ -42,6 +42,7 @@ import org.assertj.core.api.InstanceOfAssertFactories; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -74,7 +75,6 @@ import org.springframework.data.elasticsearch.core.query.*; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** @@ -1335,12 +1335,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } @@ -1448,12 +1447,11 @@ public void setSeqNoPrimaryTerm(@Nullable SeqNoPrimaryTerm seqNoPrimaryTerm) { this.seqNoPrimaryTerm = seqNoPrimaryTerm; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } @@ -1474,12 +1472,11 @@ public void setId(@Nullable String id) { this.id = id; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java index b6b269592..e8163f899 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactivePointInTimeIntegrationTests.java @@ -21,6 +21,7 @@ import java.time.Duration; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java index e1dddee38..43e501936 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveReindexIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.regex.Pattern; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.core.reindex.ReindexRequest; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * x * Note: the imperative version of these tests have more details and test methods, but they test that the request is diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java index 7b3abbd9e..f9f143d7d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReactiveSearchTemplateIntegrationTests.java @@ -25,6 +25,7 @@ import java.util.Map; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -40,7 +41,6 @@ import org.springframework.data.elasticsearch.core.script.Script; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Integration tests for the point in time API. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java index 03d2485ef..2e7778108 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ReindexIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.regex.Pattern; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.core.reindex.ReindexResponse; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java index 429abe919..b463ecaab 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchAsYouTypeIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.Objects; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Aleksei Arsenev diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java index e6339c208..e22c6e3b4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SearchTemplateIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.Map; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.script.Script; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Integration tests search template API. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java index 11137ce88..f08bc810a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/SourceFilterIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.Collections; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.core.query.SourceFilter; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch @@ -208,7 +208,7 @@ void shouldNotReturnAnyFieldsWhenSourceIsSetToFalse() { void shouldReturnAllFieldsWhenSourceIsSetToTrue() { Query query = Query.findAll(); - query.addSourceFilter(FetchSourceFilter.of(b -> b.withFetchSource(true))); + query.addSourceFilter(FetchSourceFilter.of(b -> b.withFetchSource(true))); SearchHits entities = operations.search(query, Entity.class); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java index ec6fa95fb..106eb3123 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/aggregation/AggregationIntegrationTests.java @@ -17,12 +17,11 @@ import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; -import static org.springframework.data.elasticsearch.annotations.FieldType.Integer; -import java.lang.Integer; import java.util.ArrayList; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -41,7 +40,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java index 985a17ad3..659e461d9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverterUnitTests.java @@ -30,6 +30,7 @@ import org.intellij.lang.annotations.Language; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -73,7 +74,6 @@ import org.springframework.data.geo.Circle; import org.springframework.data.geo.Point; import org.springframework.data.geo.Polygon; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -1807,18 +1807,16 @@ void shouldReadASingleStringIntoAListPropertyImmutable() { void shouldPopulateScriptedFields() { SearchDocumentAdapter document = new SearchDocumentAdapter(Document.create(), 0.0f, - new Object[]{}, + new Object[] {}, Map.of( - "scriptedField" , List.of("scriptedField"), - "custom-name-scripted-field" , List.of("custom-name-scripted-field") - ), + "scriptedField", List.of("scriptedField"), + "custom-name-scripted-field", List.of("custom-name-scripted-field")), emptyMap(), emptyMap(), null, null, null, - null - ); + null); // Create a SearchDocument instance var entity = mappingElasticsearchConverter.read(ScriptedEntity.class, document); assertThat(entity.customScriptedField).isEqualTo("custom-name-scripted-field"); @@ -1826,8 +1824,7 @@ void shouldPopulateScriptedFields() { } static class ScriptedEntity { - @ScriptedField - private String scriptedField; + @ScriptedField private String scriptedField; @ScriptedField(name = "custom-name-scripted-field") String customScriptedField; ScriptedEntity() { @@ -1853,9 +1850,11 @@ public void setCustomScriptedField(String customScriptedField) { @Override public boolean equals(Object o) { - if (o == null || getClass() != o.getClass()) return false; + if (o == null || getClass() != o.getClass()) + return false; ScriptedEntity that = (ScriptedEntity) o; - return Objects.equals(scriptedField, that.scriptedField) && Objects.equals(customScriptedField, that.customScriptedField); + return Objects.equals(scriptedField, that.scriptedField) + && Objects.equals(customScriptedField, that.customScriptedField); } @Override @@ -1864,7 +1863,6 @@ public int hashCode() { } } - @Test // #2280 @DisplayName("should read a String array into a List property immutable") void shouldReadAStringArrayIntoAListPropertyImmutable() { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java index 273e0cf42..9465a1bd4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/convert/PropertyValueConvertersUnitTests.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.stream.Stream; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; import org.junit.jupiter.params.ParameterizedTest; @@ -33,7 +34,6 @@ import org.springframework.data.elasticsearch.core.mapping.PropertyValueConverter; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchPersistentEntity; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java index f3e0e2969..d95c34232 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/AuditingEntityCallbackTests.java @@ -21,6 +21,7 @@ import java.time.LocalDateTime; import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.mapping.context.PersistentEntities; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java index 991b31c6d..86ae92305 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/CallbackIntegrationTests.java @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -41,7 +42,6 @@ import org.springframework.data.elasticsearch.core.query.SeqNoPrimaryTerm; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; /** @@ -240,7 +240,7 @@ static class SampleEntity { @Id private String id; @Nullable private String text; -// @ReadOnlyProperty + // @ReadOnlyProperty @Nullable private String className; @Nullable diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java index d00a8d690..aafc41293 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveAuditingEntityCallbackTests.java @@ -24,6 +24,7 @@ import java.time.LocalDateTime; import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.mapping.context.PersistentEntities; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java index eb5f7f407..de896111c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/event/ReactiveCallbackIntegrationTests.java @@ -21,6 +21,7 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -33,7 +34,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java index 20e3b6eb5..786afe8e7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -39,7 +40,6 @@ import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.elasticsearch.utils.geohash.Geohash; import org.springframework.data.geo.Point; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java index 87c1fd095..b18e02ed6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonEntity.java @@ -17,10 +17,10 @@ import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.geo.Point; -import org.springframework.lang.Nullable; /** * this class contains each GeoJson type as explicit type and as GeoJson interface. Used by several test classes diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java index 8a5e78903..633aa97aa 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/GeoJsonIntegrationTests.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.geo.Point; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java index 3e2c8101d..0431ec73a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexOperationsIntegrationTests.java @@ -26,6 +26,7 @@ import org.assertj.core.api.InstanceOfAssertFactories; import org.assertj.core.api.SoftAssertions; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -47,7 +48,6 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java index 06209cc24..8d73d6079 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/IndexTemplateIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.UUID; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.core.query.CriteriaQuery; import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java index 36efe8182..c65867fe4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderIntegrationTests.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Set; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -43,7 +44,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Stuart Stevenson @@ -711,12 +711,11 @@ public void setText(@Nullable String text) { this.text = text; } - @Nullable - public java.lang.Object getObject() { + public java.lang.@Nullable Object getObject() { return object; } - public void setObject(@Nullable java.lang.Object object) { + public void setObject(java.lang.@Nullable Object object) { this.object = object; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java index 673d56b1f..d7a1e30a8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingBuilderUnitTests.java @@ -31,6 +31,7 @@ import java.util.Map; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -47,7 +48,6 @@ import org.springframework.data.geo.Point; import org.springframework.data.geo.Polygon; import org.springframework.data.mapping.MappingException; -import org.springframework.lang.Nullable; /** * @author Stuart Stevenson @@ -1126,49 +1126,49 @@ void shouldAddFieldsThatAreExcludedFromSource() throws JSONException { String expected = """ { - "properties": { - "_class": { - "type": "keyword", - "index": false, - "doc_values": false - }, - "excluded-date": { - "type": "date", - "format": "date" - }, - "nestedEntity": { - "type": "nested", - "properties": { - "_class": { - "type": "keyword", - "index": false, - "doc_values": false - }, - "excluded-text": { - "type": "text" - } - } - }, - "excluded-multifield": { - "type": "text", - "fields": { - "keyword": { - "type": "keyword" - } - } - } - }, - "_source": { - "excludes": [ - "excluded-date", - "nestedEntity.excluded-text", - "excluded-multifield" - ] - } + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "excluded-date": { + "type": "date", + "format": "date" + }, + "nestedEntity": { + "type": "nested", + "properties": { + "_class": { + "type": "keyword", + "index": false, + "doc_values": false + }, + "excluded-text": { + "type": "text" + } + } + }, + "excluded-multifield": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword" + } + } + } + }, + "_source": { + "excludes": [ + "excluded-date", + "nestedEntity.excluded-text", + "excluded-multifield" + ] + } } - - """; // + + """; // String mapping = getMappingBuilder().buildPropertyMapping(ExcludedFieldEntity.class); @@ -2141,21 +2141,19 @@ public void setId(@Nullable String id) { this.id = id; } - @Nullable - public java.lang.Integer getPageRank() { + public java.lang.@Nullable Integer getPageRank() { return pageRank; } - public void setPageRank(@Nullable java.lang.Integer pageRank) { + public void setPageRank(java.lang.@Nullable Integer pageRank) { this.pageRank = pageRank; } - @Nullable - public java.lang.Integer getUrlLength() { + public java.lang.@Nullable Integer getUrlLength() { return urlLength; } - public void setUrlLength(@Nullable java.lang.Integer urlLength) { + public void setUrlLength(java.lang.@Nullable Integer urlLength) { this.urlLength = urlLength; } @@ -2309,12 +2307,11 @@ public void setText(@Nullable String text) { this.text = text; } - @Nullable - public java.lang.Object getObject() { + public java.lang.@Nullable Object getObject() { return object; } - public void setObject(@Nullable java.lang.Object object) { + public void setObject(java.lang.@Nullable Object object) { this.object = object; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java index 7d424d049..1a41c6487 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/MappingParametersTest.java @@ -2,10 +2,10 @@ import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; -import static org.springframework.data.elasticsearch.annotations.FieldType.Object; import java.lang.annotation.Annotation; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.elasticsearch.annotations.Field; @@ -14,7 +14,6 @@ import org.springframework.data.elasticsearch.annotations.MultiField; import org.springframework.data.elasticsearch.core.MappingContextBaseTests; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java index ef892bc45..ba8313703 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexOperationsIntegrationTests.java @@ -29,6 +29,7 @@ import org.assertj.core.api.InstanceOfAssertFactories; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -50,7 +51,6 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java index b832a3285..4cb038324 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveIndexTemplateIntegrationTests.java @@ -27,6 +27,7 @@ import org.assertj.core.api.SoftAssertions; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -46,7 +47,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java index d9a944927..d2b171d28 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/ReactiveMappingBuilderUnitTests.java @@ -25,6 +25,7 @@ import java.util.List; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.annotations.Mapping; import org.springframework.data.elasticsearch.annotations.MultiField; import org.springframework.data.elasticsearch.core.MappingContextBaseTests; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java index 2026a5815..c827bef66 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleDynamicTemplatesMappingTests.java @@ -21,6 +21,7 @@ import java.util.Map; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.Setting; import org.springframework.data.elasticsearch.core.MappingContextBaseTests; -import org.springframework.lang.Nullable; /** * Dynamic templates tests diff --git a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java index f45158c93..a4a963c71 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/index/SimpleElasticsearchDateMappingTests.java @@ -21,6 +21,7 @@ import java.time.LocalDateTime; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.DateFormat; @@ -28,7 +29,6 @@ import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.core.MappingContextBaseTests; -import org.springframework.lang.Nullable; /** * @author Jakub Vavrik diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java index 9ad3d8337..19da497cd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/EntityCustomConversionIntegrationTests.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -39,7 +40,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Test that a whole entity can be converted using custom conversions diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java index 2ee3e39ab..35964e683 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/FieldNamingStrategyIntegrationTests.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -32,7 +33,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java index 61f839cdf..374a610e1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/ReactiveFieldNamingStrategyIntegrationTests.java @@ -19,6 +19,7 @@ import reactor.test.StepVerifier; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -32,7 +33,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java index 858ccaaa5..7c59723d3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntityTests.java @@ -19,6 +19,7 @@ import static org.skyscreamer.jsonassert.JSONAssert.*; import org.json.JSONException; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -37,7 +38,6 @@ import org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy; import org.springframework.data.mapping.model.SimpleTypeHolder; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; import org.springframework.util.ReflectionUtils; /** @@ -172,7 +172,7 @@ void shouldErrorIfIndexSortingParametersDoNotHaveTheSameNumberOfArguments() { assertThatThrownBy(() -> elasticsearchConverter.get().getMappingContext() .getRequiredPersistentEntity(SettingsInvalidSortParameterSizes.class).getDefaultSettings()) - .isInstanceOf(IllegalArgumentException.class); + .isInstanceOf(IllegalArgumentException.class); } @Test // #1719, #2158 diff --git a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java index e723143cf..ac5fab3bd 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentPropertyUnitTests.java @@ -25,6 +25,7 @@ import java.util.GregorianCalendar; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -44,7 +45,6 @@ import org.springframework.data.mapping.model.SimpleTypeHolder; import org.springframework.data.mapping.model.SnakeCaseFieldNamingStrategy; import org.springframework.data.util.TypeInformation; -import org.springframework.lang.Nullable; import org.springframework.util.ReflectionUtils; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java index 62951e4c7..fc75eacc9 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/ReactiveSearchAfterIntegrationTests.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -43,7 +44,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java index 674a03162..89d350385 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/SearchAfterIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -41,7 +42,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/paginating/package-info.java b/src/test/java/org/springframework/data/elasticsearch/core/paginating/package-info.java index d242ad337..d82a51c47 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/paginating/package-info.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/paginating/package-info.java @@ -1,6 +1,5 @@ /** * Test for paginating support with search_after and point_in_time API */ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.core.paginating; diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java index 2d91462e1..24acedc9d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/CriteriaQueryIntegrationTests.java @@ -20,10 +20,10 @@ import static org.springframework.data.elasticsearch.utils.IdGenerator.*; import static org.springframework.data.elasticsearch.utils.IndexBuilder.*; -import java.lang.Long; import java.util.ArrayList; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -38,7 +38,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees @@ -762,12 +761,11 @@ public void setRate(int rate) { this.rate = rate; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java index 30a29af12..21f613f16 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/NativeQueryIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java index 0a5c963f5..617ea0ef3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/RepositoryPartQueryIntegrationTests.java @@ -25,6 +25,7 @@ import org.json.JSONException; import org.junit.jupiter.api.DisplayName; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.annotation.Id; @@ -39,7 +40,6 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; /** * Tests for {@link RepositoryPartQuery}. The tests make sure that queries are built according to the method naming. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java index b093d1246..deef102e0 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java @@ -25,6 +25,7 @@ import java.util.Map; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -51,7 +52,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java index 14cedf76b..20f29ab66 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.Map; import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -48,7 +49,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java index 513923554..f6ee3aaa4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/sort/NestedSortIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.List; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Integration tests for nested sorts. diff --git a/src/test/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolverUnitTest.java b/src/test/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolverUnitTest.java index 5ad256b03..349f8a3f4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolverUnitTest.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/routing/DefaultRoutingResolverUnitTest.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Routing; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; -import org.springframework.lang.Nullable; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; /** @@ -40,7 +40,7 @@ class DefaultRoutingResolverUnitTest { @Autowired private ApplicationContext applicationContext; - @Nullable private RoutingResolver routingResolver; + @Nullable private RoutingResolver routingResolver; @Configuration static class Config { @@ -52,7 +52,7 @@ SpelRouting spelRouting() { @BeforeEach void setUp() { - SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext(); + SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext(); mappingContext.setApplicationContext(applicationContext); routingResolver = new DefaultRoutingResolver(mappingContext); @@ -92,7 +92,8 @@ void shouldReturnRoutingFromSpElExpression() { @Document(indexName = "routing-resolver-test") @Routing("theRouting") static class ValidRoutingEntity { - @Nullable @Id private String id; + @Nullable + @Id private String id; @Nullable private String theRouting; public ValidRoutingEntity(@Nullable String id, @Nullable String theRouting) { @@ -122,7 +123,8 @@ public void setTheRouting(@Nullable String theRouting) { @Document(indexName = "routing-resolver-test") @Routing(value = "@spelRouting.getRouting(#entity)") static class ValidSpelRoutingEntity { - @Nullable @Id private String id; + @Nullable + @Id private String id; @Nullable private String theRouting; public ValidSpelRoutingEntity(@Nullable String id, @Nullable String theRouting) { @@ -152,7 +154,8 @@ public void setTheRouting(@Nullable String theRouting) { @Document(indexName = "routing-resolver-test") @Routing("unknownProperty") static class InvalidRoutingEntity { - @Nullable @Id private String id; + @Nullable + @Id private String id; @Nullable private String theRouting; public InvalidRoutingEntity(@Nullable String id, @Nullable String theRouting) { diff --git a/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingTests.java b/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingTests.java index 95345858a..f80111f8d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/routing/ReactiveRoutingTests.java @@ -21,6 +21,7 @@ import java.util.Objects; import java.util.function.Function; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/routing/RoutingIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/routing/RoutingIntegrationTests.java index ddbc4949a..901af03ca 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/routing/RoutingIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/routing/RoutingIntegrationTests.java @@ -25,6 +25,7 @@ import org.apache.commons.codec.digest.MurmurHash3; import org.assertj.core.api.SoftAssertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -45,7 +46,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java index 8d6ddcc4f..a47eba4da 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/ReactiveSqlOperationsIntegrationTests.java @@ -21,6 +21,7 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.core.query.SqlQuery; import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java index 6e3ce29c9..b62cc7ee4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/sql/SqlOperationsIntegrationTests.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -32,7 +33,6 @@ import org.springframework.data.elasticsearch.core.query.SqlQuery; import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java index fc52f8c5b..e167a8314 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java index 148b7183b..24e495af4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Robert Gruendler diff --git a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java index 8a629516c..69f4fc8a4 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/suggest/ReactiveSuggestIntegrationTests.java @@ -24,6 +24,7 @@ import java.util.Arrays; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -40,7 +41,6 @@ import org.springframework.data.elasticsearch.core.suggest.response.Suggest; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java index a6407d15e..1236b8897 100644 --- a/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/immutable/ImmutableRepositoryIntegrationTests.java @@ -19,6 +19,7 @@ import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -30,7 +31,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.CrudRepository; -import org.springframework.lang.Nullable; /** * @author Young Gu diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java index 8ac75d000..30112fa26 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnection.java @@ -26,10 +26,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.lang.Nullable; import org.testcontainers.elasticsearch.ElasticsearchContainer; import org.testcontainers.utility.DockerImageName; @@ -195,7 +195,6 @@ private Map testcontainersProperties(String propertiesFile) { @Override public void close() { - } private static class SpringDataElasticsearchContainer extends ElasticsearchContainer { diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java index 76c837783..1a3266a9f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/ClusterConnectionInfo.java @@ -15,7 +15,7 @@ */ package org.springframework.data.elasticsearch.junit.jupiter; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; import org.testcontainers.elasticsearch.ElasticsearchContainer; diff --git a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/package-info.java b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/package-info.java index e6e754267..bf18bbf1e 100644 --- a/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/package-info.java +++ b/src/test/java/org/springframework/data/elasticsearch/junit/jupiter/package-info.java @@ -1,5 +1,5 @@ /** * interfaces, annotations and classes related to JUnit 5 test handling. */ -@org.springframework.lang.NonNullApi +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.junit.jupiter; diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java index e6b5536b2..ad7f72ec1 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryClient.java @@ -17,7 +17,7 @@ import jakarta.inject.Inject; -import org.springframework.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * @author Mohsin Husen diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java index a0b7cab66..f0236249f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/CdiRepositoryTests.java @@ -17,6 +17,9 @@ import static org.assertj.core.api.Assertions.*; +import jakarta.enterprise.inject.se.SeContainer; +import jakarta.enterprise.inject.se.SeContainerInitializer; + import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -24,9 +27,7 @@ import java.util.Map; import java.util.Optional; -import jakarta.enterprise.inject.se.SeContainer; -import jakarta.enterprise.inject.se.SeContainerInitializer; - +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -40,7 +41,6 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.IntegrationTest; -import org.springframework.lang.Nullable; /** * @author Mohsin Husen diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/package-info.java b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/package-info.java index 00c6f2bb9..065343171 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/package-info.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/cdi/package-info.java @@ -1,3 +1,2 @@ -@org.springframework.lang.NonNullApi -@org.springframework.lang.NonNullFields +@org.jspecify.annotations.NullMarked package org.springframework.data.elasticsearch.repositories.cdi; diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java index 856efdf0a..435c018c8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/autowiring/ComplexCustomMethodRepositoryIntegrationTests.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Artur Konczak diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java index 5f5490b49..4f74e728a 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/complex/custommethod/manualwiring/ComplexCustomMethodRepositoryManualWiringIntegrationTests.java @@ -18,6 +18,7 @@ import static org.assertj.core.api.Assertions.*; import static org.springframework.data.elasticsearch.annotations.FieldType.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Artur Konczak diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java index 1b19b0cbe..bdbc8b775 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/custommethod/CustomMethodRepositoryIntegrationTests.java @@ -29,6 +29,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -66,7 +67,6 @@ import org.springframework.data.geo.Metrics; import org.springframework.data.geo.Point; import org.springframework.data.repository.query.Param; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -2534,12 +2534,11 @@ public void setLocation(@Nullable GeoPoint location) { this.location = location; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } } diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java index 4ab491863..c876044d8 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/geo/GeoRepositoryIntegrationTests.java @@ -20,6 +20,7 @@ import java.util.Locale; import java.util.Optional; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -38,7 +39,6 @@ import org.springframework.data.geo.Circle; import org.springframework.data.geo.Point; import org.springframework.data.geo.Polygon; -import org.springframework.lang.Nullable; /** * @author Mark Paluch diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java index 2c7027c34..12af3ecce 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/knn/KnnSearchIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.UUID; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -43,7 +44,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Haibo Liu diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java index 90f3a2a10..8c744e28f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/nestedobject/InnerObjectIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Mohsin Husen diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java index ea418a2be..d28685a16 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/synonym/SynonymRepositoryIntegrationTests.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -34,7 +35,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * SynonymRepositoryIntegrationTests diff --git a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java index 00dae64e2..cb279b7ee 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repositories/uuidkeyed/UUIDElasticsearchRepositoryIntegrationTests.java @@ -24,6 +24,7 @@ import java.util.Optional; import java.util.UUID; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -38,13 +39,11 @@ import org.springframework.data.elasticsearch.annotations.FieldType; import org.springframework.data.elasticsearch.annotations.ScriptedField; import org.springframework.data.elasticsearch.core.ElasticsearchOperations; -import org.springframework.data.elasticsearch.core.IndexOperations; import org.springframework.data.elasticsearch.core.geo.GeoPoint; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Gad Akuka @@ -61,12 +60,12 @@ public abstract class UUIDElasticsearchRepositoryIntegrationTests { @Autowired private SampleUUIDKeyedElasticsearchRepository repository; @Autowired ElasticsearchOperations operations; - @Autowired IndexNameProvider indexNameProvider; + @Autowired IndexNameProvider indexNameProvider; @BeforeEach public void before() { indexNameProvider.increment(); - operations.indexOps(SampleEntityUUIDKeyed.class).createWithMapping(); + operations.indexOps(SampleEntityUUIDKeyed.class).createWithMapping(); } @Test diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java index 79b43c3e6..67066c220 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/config/ReactiveElasticsearchRepositoriesRegistrarTests.java @@ -18,6 +18,7 @@ import static org.springframework.data.elasticsearch.annotations.FieldType.*; import org.assertj.core.api.Assertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -30,7 +31,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.ReactiveElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; -import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; /** diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java index abf2f4157..00ec7a663 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ElasticsearchQueryMethodUnitTests.java @@ -20,6 +20,7 @@ import java.lang.reflect.Method; import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -32,7 +33,6 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.Repository; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java index 84adf695d..460ede866 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveElasticsearchQueryMethodUnitTests.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -45,7 +46,6 @@ import org.springframework.data.projection.SpelAwareProxyProjectionFactory; import org.springframework.data.repository.Repository; import org.springframework.data.repository.core.support.DefaultRepositoryMetadata; -import org.springframework.lang.Nullable; /** * @author Christoph Strobl @@ -77,7 +77,7 @@ public void rejectsNullMappingContext() throws Exception { assertThatThrownBy(() -> new ReactiveElasticsearchQueryMethod(method, new DefaultRepositoryMetadata(PersonRepository.class), new SpelAwareProxyProjectionFactory(), null)) - .isInstanceOf(IllegalArgumentException.class); + .isInstanceOf(IllegalArgumentException.class); } @Test // DATAES-519 diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java index 9572e8e3b..9e6e89c19 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositorySearchTemplateQueryUnitTests.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; public class ReactiveRepositorySearchTemplateQueryUnitTests extends ReactiveRepositoryQueryUnitTestsBase { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java index 345f9816e..c6b93802b 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/ReactiveRepositoryStringQueryUnitTests.java @@ -17,7 +17,6 @@ import static org.assertj.core.api.Assertions.*; -import org.springframework.data.repository.query.ValueExpressionDelegate; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -28,6 +27,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -49,7 +49,7 @@ import org.springframework.data.elasticsearch.core.query.StringQuery; import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; import org.springframework.data.repository.Repository; -import org.springframework.lang.Nullable; +import org.springframework.data.repository.query.ValueExpressionDelegate; /** * @author Christoph Strobl diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java index b3c346bf2..6f0d996cf 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositorySearchTemplateQueryUnitTests.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.data.annotation.Id; @@ -29,7 +30,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; public class RepositorySearchTemplateQueryUnitTests extends RepositoryQueryUnitTestsBase { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java index 68c36d7ca..bb4595e47 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/RepositoryStringQueryUnitTests.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Map; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -44,7 +45,6 @@ import org.springframework.data.elasticsearch.repositories.custommethod.QueryParameter; import org.springframework.data.repository.Repository; import org.springframework.data.repository.query.ValueExpressionDelegate; -import org.springframework.lang.Nullable; /** * @author Christoph Strobl diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java index 442d49ea2..32b92dc69 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/QueryKeywordsIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.stream.Collectors; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -37,7 +38,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * base class for query keyword tests. Implemented by subclasses using ElasticsearchClient and ElasticsearchRestClient diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java index a2a4c7443..e5d05446d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/keywords/ReactiveQueryKeywordsIntegrationTests.java @@ -22,6 +22,7 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -36,7 +37,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @author Peter-Josef Meisch diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java index 3d8044844..ad36038f7 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ReactiveValueConverterIntegrationTests.java @@ -15,21 +15,10 @@ */ package org.springframework.data.elasticsearch.repository.query.valueconverter; -import static org.assertj.core.api.Assertions.*; -import static org.springframework.data.elasticsearch.annotations.FieldType.*; - -import org.springframework.data.elasticsearch.annotations.FieldType; -import org.springframework.data.elasticsearch.annotations.Query; -import org.springframework.data.elasticsearch.annotations.ValueConverter; -import org.springframework.data.elasticsearch.core.SearchHits; -import org.springframework.data.elasticsearch.core.mapping.PropertyValueConverter; -import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; import reactor.test.StepVerifier; -import java.lang.Boolean; - +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -38,13 +27,16 @@ import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; +import org.springframework.data.elasticsearch.annotations.FieldType; +import org.springframework.data.elasticsearch.annotations.Query; +import org.springframework.data.elasticsearch.annotations.ValueConverter; import org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations; import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.mapping.IndexCoordinates; +import org.springframework.data.elasticsearch.core.mapping.PropertyValueConverter; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Integration tests to check that {@link org.springframework.data.elasticsearch.annotations.ValueConverter} annotated @@ -73,7 +65,6 @@ void cleanup() { operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + '*')).delete().block(); } - @Test // #2338 @DisplayName("should apply ValueConverter") void shouldApplyValueConverter() { @@ -84,14 +75,14 @@ void shouldApplyValueConverter() { operations.save(entity).block(); repository.queryByText("text-answer") // - .as(StepVerifier::create) // - .expectNextCount(1) // - .verifyComplete(); + .as(StepVerifier::create) // + .expectNextCount(1) // + .verifyComplete(); repository.findByText("answer") // - .as(StepVerifier::create) // - .expectNextCount(1) // - .verifyComplete(); + .as(StepVerifier::create) // + .expectNextCount(1) // + .verifyComplete(); } interface EntityRepository extends ReactiveElasticsearchRepository { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java index 6fdbfc75b..f4054676d 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/query/valueconverter/ValueConverterIntegrationTests.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.*; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Order; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * Integration tests to check that {@link org.springframework.data.elasticsearch.annotations.ValueConverter} annotated diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java index 7c037b823..d4576de5f 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ElasticsearchRepositoryIntegrationTests.java @@ -28,6 +28,7 @@ import java.util.stream.Collectors; import org.assertj.core.api.Assertions; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -47,7 +48,6 @@ import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.util.StreamUtils; -import org.springframework.lang.Nullable; /** * @author Rizwan Idrees @@ -712,12 +712,11 @@ public void setAvailable(boolean available) { this.available = available; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java index 674db9bfa..f5729f347 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/ReactiveRepositoryQueryIntegrationTests.java @@ -22,6 +22,7 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -38,7 +39,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; /** * @since 5.5 diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java index 4787d7773..39db45c18 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/RepositoryQueryIntegrationTests.java @@ -19,6 +19,7 @@ import java.util.List; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -35,7 +36,6 @@ import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; -import org.springframework.lang.Nullable; @SpringIntegrationTest abstract class RepositoryQueryIntegrationTests { diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java index 17fddb928..6141870f6 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/SimpleReactiveElasticsearchRepositoryIntegrationTests.java @@ -33,6 +33,7 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -63,7 +64,6 @@ import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.query.Param; import org.springframework.data.repository.reactive.ReactiveCrudRepository; -import org.springframework.lang.Nullable; /** * @author Christoph Strobl @@ -1378,12 +1378,11 @@ public void setAvailable(boolean available) { this.available = available; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java index 9bace28ed..e8c89e35c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/QueryByExampleElasticsearchExecutorIntegrationTests.java @@ -23,6 +23,7 @@ import java.util.Optional; import org.assertj.core.api.AbstractThrowableAssert; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -43,7 +44,6 @@ import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.query.QueryByExampleExecutor; -import org.springframework.lang.Nullable; /** * @author Ezequiel Antúnez Camacho @@ -526,12 +526,11 @@ public void setSampleNestedEntity(SampleNestedEntity sampleNestedEntity) { this.sampleNestedEntity = sampleNestedEntity; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } diff --git a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java index 7593d5c25..3a0948224 100644 --- a/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/repository/support/querybyexample/ReactiveQueryByExampleElasticsearchExecutorIntegrationTests.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Objects; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -43,7 +44,6 @@ import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; import org.springframework.data.repository.query.ReactiveQueryByExampleExecutor; -import org.springframework.lang.Nullable; /** * @author Ezequiel Antúnez Camacho @@ -483,9 +483,9 @@ static class SampleEntity { @Field(type = FieldType.Keyword, store = true) private String message; @Nullable private Integer rate; @Nullable private Boolean available; - @Nullable + @Field(type = FieldType.Nested, store = true, - fielddata = true) private SampleEntity.SampleNestedEntity sampleNestedEntity; + fielddata = true) private SampleEntity.@Nullable SampleNestedEntity sampleNestedEntity; @Nullable @Version private Long version; @@ -534,8 +534,7 @@ public void setAvailable(Boolean available) { this.available = available; } - @Nullable - public SampleEntity.SampleNestedEntity getSampleNestedEntity() { + public SampleEntity.@Nullable SampleNestedEntity getSampleNestedEntity() { return sampleNestedEntity; } @@ -543,12 +542,11 @@ public void setSampleNestedEntity(SampleEntity.SampleNestedEntity sampleNestedEn this.sampleNestedEntity = sampleNestedEntity; } - @Nullable - public java.lang.Long getVersion() { + public java.lang.@Nullable Long getVersion() { return version; } - public void setVersion(@Nullable java.lang.Long version) { + public void setVersion(java.lang.@Nullable Long version) { this.version = version; } From e81810c0d7f576ede999ff7e0f54d2b0452d1d89 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 14:29:21 +0200 Subject: [PATCH 117/131] Prepare 6.0 M2 (2025.1.0). See #3047 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 924646d62..44e911b65 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-SNAPSHOT + 4.0.0-M2 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-SNAPSHOT + 4.0.0-M2 8.18.1 @@ -462,20 +462,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index c9ad4c05b..0ca3a372e 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 6.0 M1 (2025.1.0) +Spring Data Elasticsearch 6.0 M2 (2025.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -8,3 +8,4 @@ This product may include a number of subcomponents with separate copyright notices and license terms. Your use of the source code for the these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. + From af13fe0247a8f37ce13fda14e928e21f97304ee1 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 14:29:39 +0200 Subject: [PATCH 118/131] Release version 6.0 M2 (2025.1.0). See #3047 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 44e911b65..d1b63a796 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-SNAPSHOT + 6.0.0-M2 org.springframework.data.build From eb42312ebecae28dbe2377bbe3459ced8e709769 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 14:32:03 +0200 Subject: [PATCH 119/131] Prepare next development iteration. See #3047 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d1b63a796..44e911b65 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-M2 + 6.0.0-SNAPSHOT org.springframework.data.build From 2678cdc7b62aa72cf98cd63803a0e7e4eab6da07 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 22 Apr 2025 14:32:04 +0200 Subject: [PATCH 120/131] After release cleanups. See #3047 --- pom.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 44e911b65..924646d62 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-M2 + 4.0.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-M2 + 4.0.0-SNAPSHOT 8.18.1 @@ -462,8 +462,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From a8557a36dcaa0950e420b1fc6bfee7a6140d5c9e Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 08:54:46 +0200 Subject: [PATCH 121/131] Update CI Properties. See #3097 --- ci/pipeline.properties | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 8dd2295ac..cde4a8e88 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -1,5 +1,5 @@ # Java versions -java.main.tag=17.0.15_6-jdk-focal +java.main.tag=24.0.1_9-jdk-noble java.next.tag=24.0.1_9-jdk-noble # Docker container images - standard @@ -14,7 +14,6 @@ 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.valkey.8.version=8.1.1 # Docker environment settings docker.java.inside.basic=-v $HOME:/tmp/jenkins-home From 897cb0a957ab33fb5e011969f19155bcf97be84e Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Mon, 12 May 2025 12:05:42 +0200 Subject: [PATCH 122/131] Add optional Querydsl dependency. Closes #3107 --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 924646d62..5a5bbef47 100644 --- a/pom.xml +++ b/pom.xml @@ -144,6 +144,13 @@ + + com.querydsl + querydsl-core + ${querydsl} + true + + com.fasterxml.jackson.core From 06704d974d6ffa15da779a1e60029bdd2e43bb5a Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 14:15:56 +0200 Subject: [PATCH 123/131] Prepare 6.0 M3 (2025.1.0). See #3097 --- pom.xml | 20 ++++---------------- src/main/resources/notice.txt | 3 ++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 5a5bbef47..b1e596204 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-SNAPSHOT + 4.0.0-M3 Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-SNAPSHOT + 4.0.0-M3 8.18.1 @@ -469,20 +469,8 @@ - - spring-snapshot - https://repo.spring.io/snapshot - - true - - - false - - - - spring-milestone - https://repo.spring.io/milestone - + + diff --git a/src/main/resources/notice.txt b/src/main/resources/notice.txt index 0ca3a372e..1966e7743 100644 --- a/src/main/resources/notice.txt +++ b/src/main/resources/notice.txt @@ -1,4 +1,4 @@ -Spring Data Elasticsearch 6.0 M2 (2025.1.0) +Spring Data Elasticsearch 6.0 M3 (2025.1.0) Copyright (c) [2013-2022] Pivotal Software, Inc. This product is licensed to you under the Apache License, Version 2.0 (the "License"). @@ -9,3 +9,4 @@ separate copyright notices and license terms. Your use of the source code for the these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. + From 77ba620fc6d1881ad72af61cadabd269cc4e0a26 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 14:16:18 +0200 Subject: [PATCH 124/131] Release version 6.0 M3 (2025.1.0). See #3097 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b1e596204..5c527ecf2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-SNAPSHOT + 6.0.0-M3 org.springframework.data.build From 62fcbd44fafd5149c8a0f6263f7a91d4f734867d Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 14:18:47 +0200 Subject: [PATCH 125/131] Prepare next development iteration. See #3097 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c527ecf2..b1e596204 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-elasticsearch - 6.0.0-M3 + 6.0.0-SNAPSHOT org.springframework.data.build From 923787c2d15a475bcdc6baa88a121a1a5443c91b Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 16 May 2025 14:18:48 +0200 Subject: [PATCH 126/131] After release cleanups. See #3097 --- pom.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index b1e596204..5a5bbef47 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.springframework.data.build spring-data-parent - 4.0.0-M3 + 4.0.0-SNAPSHOT Spring Data Elasticsearch @@ -18,7 +18,7 @@ https://github.com/spring-projects/spring-data-elasticsearch - 4.0.0-M3 + 4.0.0-SNAPSHOT 8.18.1 @@ -469,8 +469,20 @@ - - + + spring-snapshot + https://repo.spring.io/snapshot + + true + + + false + + + + spring-milestone + https://repo.spring.io/milestone + From 62681335063f0a35042ba25b6f6656a316942ca8 Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 24 May 2025 14:58:04 +0200 Subject: [PATCH 127/131] Update versions documentation Signed-off-by: Peter-Josef Meisch --- .../antora/modules/ROOT/pages/elasticsearch/versions.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index b626405a8..23990e2a7 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc @@ -6,8 +6,8 @@ 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 (in development) | 6.0.x | 8.17.2 | 6.2.x -| 2025.0 | 5.5.x | 8.17.2 | 6.2.x +| 2025.1 (in development) | 6.0.x | 8.18.1 | 7.0.x +| 2025.0 | 5.5.x | 8.18.1 | 6.2.x | 2024.1 | 5.4.x | 8.15.5 | 6.1.x | 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x | 2023.1 (Vaughan) | 5.2.xfootnote:oom[] | 8.11.1 | 6.1.x From 158f5fc342a0933a09ad2beacb17c5b0540e861f Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Thu, 29 May 2025 15:56:35 +0200 Subject: [PATCH 128/131] es java client major update. Original Pull Request #3116 Closes #3110 Signed-off-by: Laura Trotta --- pom.xml | 2 +- .../client/elc/DocumentAdapters.java | 2 +- .../ReactiveElasticsearchIndicesClient.java | 8 --- .../client/elc/RequestConverter.java | 63 ++++++++++--------- .../client/elc/ResponseConverter.java | 8 +-- .../data/elasticsearch/core/SearchHit.java | 8 +-- .../core/document/SearchDocument.java | 2 +- .../core/document/SearchDocumentAdapter.java | 6 +- .../elasticsearch/core/query/ScriptData.java | 24 ++----- .../elasticsearch/core/query/ScriptType.java | 27 -------- .../elasticsearch/core/query/UpdateQuery.java | 19 ++---- .../core/reindex/ReindexRequest.java | 7 +-- .../elasticsearch/core/script/Script.java | 4 -- .../client/elc/DocumentAdaptersUnitTests.java | 9 +-- .../ElasticsearchELCIntegrationTests.java | 3 +- .../core/ElasticsearchIntegrationTests.java | 1 - ...iptedAndRuntimeFieldsIntegrationTests.java | 2 - ...iptedAndRuntimeFieldsIntegrationTests.java | 2 - .../testcontainers-elasticsearch.properties | 2 +- 19 files changed, 68 insertions(+), 131 deletions(-) delete mode 100644 src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java diff --git a/pom.xml b/pom.xml index 5a5bbef47..4396ce5a6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 4.0.0-SNAPSHOT - 8.18.1 + 9.0.1 0.19.0 2.23.1 diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java index ccb937bf7..ea38dfe58 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java @@ -83,7 +83,7 @@ public static SearchDocument from(Hit hit, JsonpMapper jsonpMapper) { Explanation explanation = from(hit.explanation()); - List matchedQueries = hit.matchedQueries(); + Map matchedQueries = hit.matchedQueries(); Function, EntityAsMap> fromFields = fields -> { StringBuilder sb = new StringBuilder("{"); diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java index e5f6df392..3ebde9776 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/ReactiveElasticsearchIndicesClient.java @@ -539,14 +539,6 @@ public Mono stats() { return stats(builder -> builder); } - public Mono unfreeze(UnfreezeRequest request) { - return Mono.fromFuture(transport.performRequestAsync(request, UnfreezeRequest._ENDPOINT, transportOptions)); - } - - public Mono unfreeze(Function> fn) { - return unfreeze(fn.apply(new UnfreezeRequest.Builder()).build()); - } - public Mono updateAliases(UpdateAliasesRequest request) { return Mono.fromFuture(transport.performRequestAsync(request, UpdateAliasesRequest._ENDPOINT, transportOptions)); } 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 a8d8beabe..e1a6c0927 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 @@ -42,10 +42,10 @@ import co.elastic.clients.elasticsearch.core.bulk.IndexOperation; import co.elastic.clients.elasticsearch.core.bulk.UpdateOperation; import co.elastic.clients.elasticsearch.core.mget.MultiGetOperation; -import co.elastic.clients.elasticsearch.core.msearch.MultisearchBody; import co.elastic.clients.elasticsearch.core.msearch.MultisearchHeader; import co.elastic.clients.elasticsearch.core.search.Highlight; 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; @@ -751,11 +751,10 @@ private CreateOperation bulkCreateOperation(IndexQuery query, IndexCoordinate } return co.elastic.clients.elasticsearch._types.Script.of(sb -> { sb.lang(scriptData.language()) - .params(params); - if (scriptData.type() == ScriptType.INLINE) { - sb.source(scriptData.script()); - } else if (scriptData.type() == ScriptType.STORED) { - sb.id(scriptData.script()); + .params(params) + .id(scriptData.scriptName()); + if (scriptData.script() != null){ + sb.source(s -> s.scriptString(scriptData.script())); } return sb; }); @@ -927,9 +926,13 @@ public co.elastic.clients.elasticsearch.core.ReindexRequest reindex(ReindexReque ReindexRequest.Script script = reindexRequest.getScript(); if (script != null) { - builder.script(sb -> sb - .lang(script.getLang()) - .source(script.getSource())); + builder.script(sb -> { + if (script.getSource() != null){ + sb.source(s -> s.scriptString(script.getSource())); + } + sb.lang(script.getLang()); + return sb; + }); } builder.timeout(time(reindexRequest.getTimeout())) // @@ -1086,12 +1089,11 @@ public DeleteByQueryRequest documentDeleteByQueryRequest(DeleteQuery query, @Nul uqb.script(sb -> { sb.lang(query.getLang()).params(params); - - if (query.getScriptType() == ScriptType.INLINE) { - sb.source(query.getScript()); // - } else if (query.getScriptType() == ScriptType.STORED) { - sb.id(query.getScript()); + if (query.getScript() != null){ + sb.source(s -> s.scriptString(query.getScript())); } + sb.id(query.getId()); + return sb; }); } @@ -1254,11 +1256,11 @@ public MsearchTemplateRequest searchMsearchTemplateRequest( mtrb.searchTemplates(stb -> stb .header(msearchHeaderBuilder(query, param.index(), routing)) .body(bb -> { - bb // - .explain(query.getExplain()) // - .id(query.getId()) // - .source(query.getSource()) // - ; + bb.explain(query.getExplain()) // + .id(query.getId()); // + if (query.getSource() != null){ + bb.source(s -> s.scriptString(query.getSource())); + } if (!CollectionUtils.isEmpty(query.getParams())) { Map params = getTemplateParams(query.getParams().entrySet()); @@ -1349,7 +1351,9 @@ public MsearchRequest searchMsearchRequest( if (script != null) { rfb.script(s -> { - s.source(script); + if (script != null) { + s.source(so -> so.scriptString(script)); + } if (runtimeField.getParams() != null) { s.params(TypeUtils.paramsMap(runtimeField.getParams())); @@ -1551,7 +1555,9 @@ private void prepareSearchRequest(Query query, @Nullable String routing, @Nu String script = runtimeField.getScript(); if (script != null) { rfb.script(s -> { - s.source(script); + if (script != null) { + s.source(so -> so.scriptString(script)); + } if (runtimeField.getParams() != null) { s.params(TypeUtils.paramsMap(runtimeField.getParams())); @@ -1648,7 +1654,7 @@ private void addHighlight(Query query, SearchRequest.Builder builder) { builder.highlight(highlight); } - private void addHighlight(Query query, MultisearchBody.Builder builder) { + private void addHighlight(Query query, SearchRequestBody.Builder builder) { Highlight highlight = query.getHighlightQuery() .map(highlightQuery -> new HighlightQueryBuilder(elasticsearchConverter.getMappingContext(), this) @@ -1772,7 +1778,7 @@ private void prepareNativeSearch(NativeQuery query, SearchRequest.Builder builde } @SuppressWarnings("DuplicatedCode") - private void prepareNativeSearch(NativeQuery query, MultisearchBody.Builder builder) { + private void prepareNativeSearch(NativeQuery query, SearchRequestBody.Builder builder) { builder // .suggest(query.getSuggester()) // @@ -1891,10 +1897,11 @@ public SearchTemplateRequest searchTemplate(SearchTemplateQuery query, @Nullable .id(query.getId()) // .index(Arrays.asList(index.getIndexNames())) // .preference(query.getPreference()) // - .searchType(searchType(query.getSearchType())) // - .source(query.getSource()) // - ; + .searchType(searchType(query.getSearchType())); // + if (query.getSource() != null) { + builder.source(so -> so.scriptString(query.getSource())); + } if (query.getRoute() != null) { builder.routing(query.getRoute()); } else if (StringUtils.hasText(routing)) { @@ -1936,8 +1943,8 @@ public PutScriptRequest scriptPut(Script script) { return PutScriptRequest.of(b -> b // .id(script.id()) // .script(sb -> sb // - .lang(script.language()) // - .source(script.source()))); + .lang(script.language()) // + .source(s -> s.scriptString(script.source())))); } public GetScriptRequest scriptGet(String name) { 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 7024584f3..771b1104a 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 @@ -191,7 +191,7 @@ public Document indicesGetMapping(GetMappingResponse getMappingResponse, IndexCo Assert.notNull(getMappingResponse, "getMappingResponse must not be null"); Assert.notNull(indexCoordinates, "indexCoordinates must not be null"); - Map mappings = getMappingResponse.result(); + Map mappings = getMappingResponse.mappings(); if (mappings == null || mappings.isEmpty()) { return Document.create(); @@ -219,7 +219,7 @@ public List indicesGetIndexInformations(GetIndexResponse getIn List indexInformationList = new ArrayList<>(); - getIndexResponse.result().forEach((indexName, indexState) -> { + getIndexResponse.indices().forEach((indexName, indexState) -> { Settings settings = indexState.settings() != null ? Settings.parse(toJson(indexState.settings(), jsonpMapper)) : new Settings(); Document mappings = indexState.mappings() != null ? Document.parse(toJson(indexState.mappings(), jsonpMapper)) @@ -239,7 +239,7 @@ public Map> indicesGetAliasData(GetAliasResponse getAlias Assert.notNull(getAliasResponse, "getAliasResponse must not be null"); Map> aliasDataMap = new HashMap<>(); - getAliasResponse.result().forEach((indexName, alias) -> { + getAliasResponse.aliases().forEach((indexName, alias) -> { Set aliasDataSet = new HashSet<>(); alias.aliases() .forEach((aliasName, aliasDefinition) -> aliasDataSet.add(indicesGetAliasData(aliasName, aliasDefinition))); @@ -535,7 +535,7 @@ public Script scriptResponse(GetScriptResponse response) { ? Script.builder() // .withId(response.id()) // .withLanguage(response.script().lang()) // - .withSource(response.script().source()).build() // + .withSource(response.script().source().scriptString()).build() // : null; } // endregion diff --git a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java index da59efdf5..6a6f21920 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java @@ -48,12 +48,12 @@ public class SearchHit { @Nullable private final NestedMetaData nestedMetaData; @Nullable private final String routing; @Nullable private final Explanation explanation; - private final List matchedQueries = new ArrayList<>(); + private final Map matchedQueries = new LinkedHashMap<>(); public SearchHit(@Nullable String index, @Nullable String id, @Nullable String routing, float score, @Nullable Object[] sortValues, @Nullable Map> highlightFields, @Nullable Map> innerHits, @Nullable NestedMetaData nestedMetaData, - @Nullable Explanation explanation, @Nullable List matchedQueries, T content) { + @Nullable Explanation explanation, @Nullable Map matchedQueries, T content) { this.index = index; this.id = id; this.routing = routing; @@ -73,7 +73,7 @@ public SearchHit(@Nullable String index, @Nullable String id, @Nullable String r this.content = content; if (matchedQueries != null) { - this.matchedQueries.addAll(matchedQueries); + this.matchedQueries.putAll(matchedQueries); } } @@ -194,7 +194,7 @@ public Explanation getExplanation() { * @return the matched queries for this SearchHit. */ @Nullable - public List getMatchedQueries() { + public Map getMatchedQueries() { return matchedQueries; } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java index 63192272e..b51c028e7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java @@ -125,5 +125,5 @@ default String getRouting() { * @return the matched queries for the SearchHit. */ @Nullable - List getMatchedQueries(); + Map getMatchedQueries(); } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java index de424c719..4a1bf2f35 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocumentAdapter.java @@ -41,12 +41,12 @@ public class SearchDocumentAdapter implements SearchDocument { private final Map innerHits = new HashMap<>(); @Nullable private final NestedMetaData nestedMetaData; @Nullable private final Explanation explanation; - @Nullable private final List matchedQueries; + @Nullable private final Map matchedQueries; @Nullable private final String routing; public SearchDocumentAdapter(Document delegate, float score, Object[] sortValues, Map> fields, Map> highlightFields, Map innerHits, - @Nullable NestedMetaData nestedMetaData, @Nullable Explanation explanation, @Nullable List matchedQueries, + @Nullable NestedMetaData nestedMetaData, @Nullable Explanation explanation, @Nullable Map matchedQueries, @Nullable String routing) { this.delegate = delegate; @@ -249,7 +249,7 @@ public Explanation getExplanation() { @Override @Nullable - public List getMatchedQueries() { + public Map getMatchedQueries() { return matchedQueries; } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java index 1a81988cd..1597f064f 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java @@ -27,15 +27,12 @@ * @author Peter-Josef Meisch * @since 4.4 */ -public record ScriptData(ScriptType type, @Nullable String language, @Nullable String script, +public record ScriptData(@Nullable String language, @Nullable String script, @Nullable String scriptName, @Nullable Map params) { - public ScriptData(ScriptType type, @Nullable String language, @Nullable String script, @Nullable String scriptName, + public ScriptData(@Nullable String language, @Nullable String script, @Nullable String scriptName, @Nullable Map params) { - Assert.notNull(type, "type must not be null"); - - this.type = type; this.language = language; this.script = script; this.scriptName = scriptName; @@ -45,9 +42,9 @@ public ScriptData(ScriptType type, @Nullable String language, @Nullable String s /** * @since 5.2 */ - public static ScriptData of(ScriptType type, @Nullable String language, @Nullable String script, + public static ScriptData of(@Nullable String language, @Nullable String script, @Nullable String scriptName, @Nullable Map params) { - return new ScriptData(type, language, script, scriptName, params); + return new ScriptData(language, script, scriptName, params); } public static ScriptData of(Function builderFunction) { @@ -68,7 +65,6 @@ public static Builder builder() { * @since 5.2 */ public static final class Builder { - @Nullable private ScriptType type; @Nullable private String language; @Nullable private String script; @Nullable private String scriptName; @@ -76,14 +72,6 @@ public static final class Builder { private Builder() {} - public Builder withType(ScriptType type) { - - Assert.notNull(type, "type must not be null"); - - this.type = type; - return this; - } - public Builder withLanguage(@Nullable String language) { this.language = language; return this; @@ -106,9 +94,7 @@ public Builder withParams(@Nullable Map params) { public ScriptData build() { - Assert.notNull(type, "type must be set"); - - return new ScriptData(type, language, script, scriptName, params); + return new ScriptData(language, script, scriptName, params); } } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java deleted file mode 100644 index 1c6ceecab..000000000 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2021-2025 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.data.elasticsearch.core.query; - -/** - * Define script types for update queries. - * - * @author Farid Faoudi - * @since 4.2 - */ - -public enum ScriptType { - INLINE, STORED -} diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java index 087f0c105..75959bb56 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/UpdateQuery.java @@ -76,7 +76,7 @@ private UpdateQuery(String id, @Nullable String script, @Nullable Map searchHit = new Hit.Builder() // .index("index") // .id("42") // - .matchedQueries("query1", "query2") // + .matchedQueries("query1", 1D) // .build(); SearchDocument searchDocument = DocumentAdapters.from(searchHit, jsonpMapper); SoftAssertions softly = new SoftAssertions(); - List matchedQueries = searchDocument.getMatchedQueries(); + Map matchedQueries = searchDocument.getMatchedQueries(); softly.assertThat(matchedQueries).isNotNull(); - softly.assertThat(matchedQueries).hasSize(2); - softly.assertThat(matchedQueries).isEqualTo(Arrays.asList("query1", "query2")); + softly.assertThat(matchedQueries).hasSize(1); + softly.assertThat(matchedQueries).isEqualTo(Map.of("query1",1D)); softly.assertAll(); } } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java index 884fde8d9..826c2e416 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchELCIntegrationTests.java @@ -46,7 +46,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.RescorerQuery; import org.springframework.data.elasticsearch.core.query.ScriptData; -import org.springframework.data.elasticsearch.core.query.ScriptType; import org.springframework.data.elasticsearch.core.query.ScriptedField; import org.springframework.data.elasticsearch.junit.jupiter.ElasticsearchTemplateConfiguration; import org.springframework.data.elasticsearch.utils.IndexNameProvider; @@ -183,7 +182,7 @@ protected Query getMatchAllQueryWithIncludesAndInlineExpressionScript(@Nullable return nativeQueryBuilder.withScriptedField(new ScriptedField( // fieldName, // - new ScriptData(ScriptType.INLINE, "expression", script, null, params))) // + new ScriptData( "expression", script, null, params))) // .build(); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java index 3a2e89212..195b11b3d 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchIntegrationTests.java @@ -1630,7 +1630,6 @@ void shouldDoUpdateByQueryForExistingDocument() { final Query query = operations.matchAllQuery(); final UpdateQuery updateQuery = UpdateQuery.builder(query) - .withScriptType(ScriptType.INLINE) .withScript("ctx._source['message'] = params['newMessage']").withLang("painless") .withParams(Collections.singletonMap("newMessage", messageAfterUpdate)).withAbortOnVersionConflict(true) .build(); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java index deef102e0..c17b4a8df 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ReactiveScriptedAndRuntimeFieldsIntegrationTests.java @@ -48,7 +48,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.RuntimeField; import org.springframework.data.elasticsearch.core.query.ScriptData; -import org.springframework.data.elasticsearch.core.query.ScriptType; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ReactiveElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; @@ -165,7 +164,6 @@ private static org.springframework.data.elasticsearch.core.query.ScriptedField g return org.springframework.data.elasticsearch.core.query.ScriptedField.of( fieldName, ScriptData.of(b -> b - .withType(ScriptType.INLINE) .withScript("doc['value'].size() > 0 ? doc['value'].value * params['factor'] : 0") .withParams(Map.of("factor", factor)))); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java index 20f29ab66..d4b147d46 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/query/scriptedandruntimefields/ScriptedAndRuntimeFieldsIntegrationTests.java @@ -45,7 +45,6 @@ import org.springframework.data.elasticsearch.core.query.Query; import org.springframework.data.elasticsearch.core.query.RuntimeField; import org.springframework.data.elasticsearch.core.query.ScriptData; -import org.springframework.data.elasticsearch.core.query.ScriptType; import org.springframework.data.elasticsearch.junit.jupiter.SpringIntegrationTest; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; import org.springframework.data.elasticsearch.utils.IndexNameProvider; @@ -314,7 +313,6 @@ private static org.springframework.data.elasticsearch.core.query.ScriptedField b return org.springframework.data.elasticsearch.core.query.ScriptedField.of( fieldName, ScriptData.of(b -> b - .withType(ScriptType.INLINE) .withScript("doc['value'].size() > 0 ? doc['value'].value * params['factor'] : 0") .withParams(Map.of("factor", factor)))); } diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index 6860b4150..a16e4a2af 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.18.1 +sde.testcontainers.image-version=9.0.1 # # # 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 From a9d2aaa93dc1c80a74638755ca83b98048e02dbb Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Thu, 29 May 2025 18:10:48 +0200 Subject: [PATCH 129/131] Polishing. Signed-off-by: Peter-Josef Meisch --- src/main/antora/modules/ROOT/nav.adoc | 1 + .../elasticsearch/elasticsearch-new.adoc | 8 + .../ROOT/pages/elasticsearch/versions.adoc | 2 +- .../migration-guide-5.5-6.0.adoc | 21 + .../client/elc/DocumentAdapters.java | 382 +++++++++--------- .../elasticsearch/core/query/ScriptData.java | 168 ++++---- .../elasticsearch/core/script/Script.java | 3 + 7 files changed, 321 insertions(+), 264 deletions(-) create mode 100644 src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.5-6.0.adoc diff --git a/src/main/antora/modules/ROOT/nav.adoc b/src/main/antora/modules/ROOT/nav.adoc index 53580343a..fa1ee8110 100644 --- a/src/main/antora/modules/ROOT/nav.adoc +++ b/src/main/antora/modules/ROOT/nav.adoc @@ -12,6 +12,7 @@ *** xref:migration-guides/migration-guide-5.2-5.3.adoc[] *** xref:migration-guides/migration-guide-5.3-5.4.adoc[] *** xref:migration-guides/migration-guide-5.4-5.5.adoc[] +*** xref:migration-guides/migration-guide-5.5-6.0.adoc[] * xref:elasticsearch.adoc[] 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 5dca4fab6..f1e07dd19 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -1,6 +1,14 @@ [[new-features]] = What's new +[[new-features.6-0-0]] +== New in Spring Data Elasticsearch 6.6 + +* Upgarde to Spring 7 +* Switch to jspecify nullability annotations +* Upgrade to Elasticsearch 9.0.1 + + [[new-features.5-5-0]] == New in Spring Data Elasticsearch 5.5 diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 23990e2a7..8fb6d7261 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.1 (in development) | 6.0.x | 8.18.1 | 7.0.x +| 2025.1 (in development) | 6.0.x | 9.0.1 | 7.0.x | 2025.0 | 5.5.x | 8.18.1 | 6.2.x | 2024.1 | 5.4.x | 8.15.5 | 6.1.x | 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x diff --git a/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.5-6.0.adoc b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.5-6.0.adoc new file mode 100644 index 000000000..7667701a1 --- /dev/null +++ b/src/main/antora/modules/ROOT/pages/migration-guides/migration-guide-5.5-6.0.adoc @@ -0,0 +1,21 @@ +[[elasticsearch-migration-guide-5.5-6.0]] += Upgrading from 5.5.x to 6.0.x + +This section describes breaking changes from version 5.5.x to 6.0.x and how removed features can be replaced by new introduced features. + +[[elasticsearch-migration-guide-5.5-6.0.breaking-changes]] +== Breaking Changes + +[[elasticsearch-migration-guide-5.5-6.0.deprecations]] +== Deprecations + + +=== Removals + +The `org.springframework.data.elasticsearch.core.query.ScriptType` enum has been removed. To distinguish between an inline and a stored script set the appropriate values in the `org.springframework.data.elasticsearch.core.query.ScriptData` record. + +These methods have been removed because the Elasticsearch Client 9 does not support them anymore: +``` +org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchIndicesClient.unfreeze(UnfreezeRequest) +org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchIndicesClient.unfreeze(Function>) +``` diff --git a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java index ea38dfe58..53e8cefa7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/elc/DocumentAdapters.java @@ -24,14 +24,6 @@ import co.elastic.clients.elasticsearch.core.search.NestedIdentity; import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpMapper; - -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jspecify.annotations.Nullable; @@ -44,6 +36,13 @@ import org.springframework.data.elasticsearch.core.document.SearchDocumentResponse; import org.springframework.util.Assert; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + /** * Utility class to adapt different Elasticsearch responses to a * {@link org.springframework.data.elasticsearch.core.document.Document} @@ -55,187 +54,188 @@ */ final class DocumentAdapters { - private static final Log LOGGER = LogFactory.getLog(DocumentAdapters.class); - - private DocumentAdapters() {} - - /** - * Creates a {@link SearchDocument} from a {@link Hit} returned by the Elasticsearch client. - * - * @param hit the hit object - * @param jsonpMapper to map JsonData objects - * @return the created {@link SearchDocument} - */ - public static SearchDocument from(Hit hit, JsonpMapper jsonpMapper) { - - Assert.notNull(hit, "hit must not be null"); - - Map> highlightFields = hit.highlight(); - - Map innerHits = new LinkedHashMap<>(); - hit.innerHits().forEach((name, innerHitsResult) -> { - // noinspection ReturnOfNull - innerHits.put(name, SearchDocumentResponseBuilder.from(innerHitsResult.hits(), null, null, null, 0, null, null, - searchDocument -> null, jsonpMapper)); - }); - - NestedMetaData nestedMetaData = from(hit.nested()); - - Explanation explanation = from(hit.explanation()); - - Map matchedQueries = hit.matchedQueries(); - - Function, EntityAsMap> fromFields = fields -> { - StringBuilder sb = new StringBuilder("{"); - final boolean[] firstField = { true }; - hit.fields().forEach((key, jsonData) -> { - if (!firstField[0]) { - sb.append(','); - } - sb.append('"').append(key).append("\":") // - .append(jsonData.toJson(jsonpMapper).toString()); - firstField[0] = false; - }); - sb.append('}'); - return new EntityAsMap().fromJson(sb.toString()); - }; - - EntityAsMap hitFieldsAsMap = fromFields.apply(hit.fields()); - - Map> documentFields = new LinkedHashMap<>(); - hitFieldsAsMap.forEach((key, value) -> { - if (value instanceof List) { - // noinspection unchecked - documentFields.put(key, (List) value); - } else { - documentFields.put(key, Collections.singletonList(value)); - } - }); - - Document document; - Object source = hit.source(); - if (source == null) { - document = Document.from(hitFieldsAsMap); - } else { - if (source instanceof EntityAsMap entityAsMap) { - document = Document.from(entityAsMap); - } else if (source instanceof JsonData jsonData) { - document = Document.from(jsonData.to(EntityAsMap.class)); - } else { - - if (LOGGER.isWarnEnabled()) { - LOGGER.warn(String.format("Cannot map from type " + source.getClass().getName())); - } - document = Document.create(); - } - } - document.setIndex(hit.index()); - document.setId(hit.id()); - - if (hit.version() != null) { - document.setVersion(hit.version()); - } - document.setSeqNo(hit.seqNo() != null && hit.seqNo() >= 0 ? hit.seqNo() : -2); // -2 was the default value in the - // old client - 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().stream().map(TypeUtils::toObject).toArray(), - documentFields, highlightFields, innerHits, nestedMetaData, explanation, matchedQueries, hit.routing()); - } - - public static SearchDocument from(CompletionSuggestOption completionSuggestOption) { - - Document document = completionSuggestOption.source() != null ? Document.from(completionSuggestOption.source()) - : Document.create(); - document.setIndex(completionSuggestOption.index()); - - if (completionSuggestOption.id() != null) { - document.setId(completionSuggestOption.id()); - } - - float score = completionSuggestOption.score() != null ? completionSuggestOption.score().floatValue() : Float.NaN; - return new SearchDocumentAdapter(document, score, new Object[] {}, Collections.emptyMap(), Collections.emptyMap(), - Collections.emptyMap(), null, null, null, completionSuggestOption.routing()); - } - - @Nullable - private static Explanation from(co.elastic.clients.elasticsearch.core.explain.@Nullable Explanation explanation) { - - if (explanation == null) { - return null; - } - List details = explanation.details().stream().map(DocumentAdapters::from).collect(Collectors.toList()); - return new Explanation(true, (double) explanation.value(), explanation.description(), details); - } - - private static Explanation from(ExplanationDetail explanationDetail) { - - List details = explanationDetail.details().stream().map(DocumentAdapters::from) - .collect(Collectors.toList()); - return new Explanation(null, (double) explanationDetail.value(), explanationDetail.description(), details); - } - - @Nullable - private static NestedMetaData from(@Nullable NestedIdentity nestedIdentity) { - - if (nestedIdentity == null) { - return null; - } - - NestedMetaData child = from(nestedIdentity.nested()); - return NestedMetaData.of(nestedIdentity.field(), nestedIdentity.offset(), child); - } - - /** - * Creates a {@link Document} from a {@link GetResponse} where the found document is contained as {@link EntityAsMap}. - * - * @param getResponse the response instance - * @return the Document - */ - @Nullable - public static Document from(GetResult getResponse) { - - Assert.notNull(getResponse, "getResponse must not be null"); - - if (!getResponse.found()) { - return null; - } - - Document document = getResponse.source() != null ? Document.from(getResponse.source()) : Document.create(); - document.setIndex(getResponse.index()); - document.setId(getResponse.id()); - - if (getResponse.version() != null) { - document.setVersion(getResponse.version()); - } - - if (getResponse.seqNo() != null) { - document.setSeqNo(getResponse.seqNo()); - } - - if (getResponse.primaryTerm() != null) { - document.setPrimaryTerm(getResponse.primaryTerm()); - } - - return document; - } - - /** - * Creates a list of {@link MultiGetItem}s from a {@link MgetResponse} where the data is contained as - * {@link EntityAsMap} instances. - * - * @param mgetResponse the response instance - * @return list of multiget items - */ - public static List> from(MgetResponse mgetResponse) { - - Assert.notNull(mgetResponse, "mgetResponse must not be null"); - - return mgetResponse.docs().stream() // - .map(itemResponse -> MultiGetItem.of( // - itemResponse.isFailure() ? null : from(itemResponse.result()), // - ResponseConverter.getFailure(itemResponse))) - .collect(Collectors.toList()); - } + private static final Log LOGGER = LogFactory.getLog(DocumentAdapters.class); + + private DocumentAdapters() { + } + + /** + * Creates a {@link SearchDocument} from a {@link Hit} returned by the Elasticsearch client. + * + * @param hit the hit object + * @param jsonpMapper to map JsonData objects + * @return the created {@link SearchDocument} + */ + public static SearchDocument from(Hit hit, JsonpMapper jsonpMapper) { + + Assert.notNull(hit, "hit must not be null"); + + Map> highlightFields = hit.highlight(); + + Map innerHits = new LinkedHashMap<>(); + hit.innerHits().forEach((name, innerHitsResult) -> { + // noinspection ReturnOfNull + innerHits.put(name, SearchDocumentResponseBuilder.from(innerHitsResult.hits(), null, null, null, 0, null, null, + searchDocument -> null, jsonpMapper)); + }); + + NestedMetaData nestedMetaData = from(hit.nested()); + + Explanation explanation = from(hit.explanation()); + + Map matchedQueries = hit.matchedQueries(); + + Function, EntityAsMap> fromFields = fields -> { + StringBuilder sb = new StringBuilder("{"); + final boolean[] firstField = {true}; + hit.fields().forEach((key, jsonData) -> { + if (!firstField[0]) { + sb.append(','); + } + sb.append('"').append(key).append("\":") // + .append(jsonData.toJson(jsonpMapper).toString()); + firstField[0] = false; + }); + sb.append('}'); + return new EntityAsMap().fromJson(sb.toString()); + }; + + EntityAsMap hitFieldsAsMap = fromFields.apply(hit.fields()); + + Map> documentFields = new LinkedHashMap<>(); + hitFieldsAsMap.forEach((key, value) -> { + if (value instanceof List) { + // noinspection unchecked + documentFields.put(key, (List) value); + } else { + documentFields.put(key, Collections.singletonList(value)); + } + }); + + Document document; + Object source = hit.source(); + if (source == null) { + document = Document.from(hitFieldsAsMap); + } else { + if (source instanceof EntityAsMap entityAsMap) { + document = Document.from(entityAsMap); + } else if (source instanceof JsonData jsonData) { + document = Document.from(jsonData.to(EntityAsMap.class)); + } else { + + if (LOGGER.isWarnEnabled()) { + LOGGER.warn(String.format("Cannot map from type " + source.getClass().getName())); + } + document = Document.create(); + } + } + document.setIndex(hit.index()); + document.setId(hit.id()); + + if (hit.version() != null) { + document.setVersion(hit.version()); + } + document.setSeqNo(hit.seqNo() != null && hit.seqNo() >= 0 ? hit.seqNo() : -2); // -2 was the default value in the + // old client + 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().stream().map(TypeUtils::toObject).toArray(), + documentFields, highlightFields, innerHits, nestedMetaData, explanation, matchedQueries, hit.routing()); + } + + public static SearchDocument from(CompletionSuggestOption completionSuggestOption) { + + Document document = completionSuggestOption.source() != null ? Document.from(completionSuggestOption.source()) + : Document.create(); + document.setIndex(completionSuggestOption.index()); + + if (completionSuggestOption.id() != null) { + document.setId(completionSuggestOption.id()); + } + + float score = completionSuggestOption.score() != null ? completionSuggestOption.score().floatValue() : Float.NaN; + return new SearchDocumentAdapter(document, score, new Object[]{}, Collections.emptyMap(), Collections.emptyMap(), + Collections.emptyMap(), null, null, null, completionSuggestOption.routing()); + } + + @Nullable + private static Explanation from(co.elastic.clients.elasticsearch.core.explain.@Nullable Explanation explanation) { + + if (explanation == null) { + return null; + } + List details = explanation.details().stream().map(DocumentAdapters::from).collect(Collectors.toList()); + return new Explanation(true, (double) explanation.value(), explanation.description(), details); + } + + private static Explanation from(ExplanationDetail explanationDetail) { + + List details = explanationDetail.details().stream().map(DocumentAdapters::from) + .collect(Collectors.toList()); + return new Explanation(null, (double) explanationDetail.value(), explanationDetail.description(), details); + } + + @Nullable + private static NestedMetaData from(@Nullable NestedIdentity nestedIdentity) { + + if (nestedIdentity == null) { + return null; + } + + NestedMetaData child = from(nestedIdentity.nested()); + return NestedMetaData.of(nestedIdentity.field(), nestedIdentity.offset(), child); + } + + /** + * Creates a {@link Document} from a {@link GetResponse} where the found document is contained as {@link EntityAsMap}. + * + * @param getResponse the response instance + * @return the Document + */ + @Nullable + public static Document from(GetResult getResponse) { + + Assert.notNull(getResponse, "getResponse must not be null"); + + if (!getResponse.found()) { + return null; + } + + Document document = getResponse.source() != null ? Document.from(getResponse.source()) : Document.create(); + document.setIndex(getResponse.index()); + document.setId(getResponse.id()); + + if (getResponse.version() != null) { + document.setVersion(getResponse.version()); + } + + if (getResponse.seqNo() != null) { + document.setSeqNo(getResponse.seqNo()); + } + + if (getResponse.primaryTerm() != null) { + document.setPrimaryTerm(getResponse.primaryTerm()); + } + + return document; + } + + /** + * Creates a list of {@link MultiGetItem}s from a {@link MgetResponse} where the data is contained as + * {@link EntityAsMap} instances. + * + * @param mgetResponse the response instance + * @return list of multiget items + */ + public static List> from(MgetResponse mgetResponse) { + + Assert.notNull(mgetResponse, "mgetResponse must not be null"); + + return mgetResponse.docs().stream() // + .map(itemResponse -> MultiGetItem.of( // + itemResponse.isFailure() ? null : from(itemResponse.result()), // + ResponseConverter.getFailure(itemResponse))) + .collect(Collectors.toList()); + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java index 1597f064f..fc81b95d4 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/query/ScriptData.java @@ -15,86 +15,110 @@ */ package org.springframework.data.elasticsearch.core.query; -import java.util.Map; -import java.util.function.Function; - import org.jspecify.annotations.Nullable; import org.springframework.util.Assert; +import java.util.Map; +import java.util.function.Function; + /** * value class combining script information. + *

+ * A script is either an inline script, then the script parameters must be set + * or it refers to a stored script, then the name parameter is required. * + * @param language the language when the script is passed in the script parameter + * @param script the script to use as inline script + * @param scriptName the name when using a stored script + * @param params the script parameters * @author Peter-Josef Meisch * @since 4.4 */ public record ScriptData(@Nullable String language, @Nullable String script, - @Nullable String scriptName, @Nullable Map params) { - - public ScriptData(@Nullable String language, @Nullable String script, @Nullable String scriptName, - @Nullable Map params) { - - this.language = language; - this.script = script; - this.scriptName = scriptName; - this.params = params; - } - - /** - * @since 5.2 - */ - public static ScriptData of(@Nullable String language, @Nullable String script, - @Nullable String scriptName, @Nullable Map params) { - return new ScriptData(language, script, scriptName, params); - } - - public static ScriptData of(Function builderFunction) { - - Assert.notNull(builderFunction, "f must not be null"); - - return builderFunction.apply(new Builder()).build(); - } - - /** - * @since 5.2 - */ - public static Builder builder() { - return new Builder(); - } - - /** - * @since 5.2 - */ - public static final class Builder { - @Nullable private String language; - @Nullable private String script; - @Nullable private String scriptName; - @Nullable private Map params; - - private Builder() {} - - public Builder withLanguage(@Nullable String language) { - this.language = language; - return this; - } - - public Builder withScript(@Nullable String script) { - this.script = script; - return this; - } - - public Builder withScriptName(@Nullable String scriptName) { - this.scriptName = scriptName; - return this; - } - - public Builder withParams(@Nullable Map params) { - this.params = params; - return this; - } - - public ScriptData build() { - - return new ScriptData(language, script, scriptName, params); - } - } + @Nullable String scriptName, @Nullable Map params) { + + /* + * constructor overload to check the parameters + */ + public ScriptData(@Nullable String language, @Nullable String script, @Nullable String scriptName, + @Nullable Map params) { + + Assert.isTrue(script != null || scriptName != null, "script or scriptName is required"); + + this.language = language; + this.script = script; + this.scriptName = scriptName; + this.params = params; + } + + /** + * factory method to create a ScriptData object. + * + * @since 5.2 + */ + public static ScriptData of(@Nullable String language, @Nullable String script, + @Nullable String scriptName, @Nullable Map params) { + return new ScriptData(language, script, scriptName, params); + } + + /** + * factory method to create a ScriptData object using a ScriptBuilder callback. + * + * @param builderFunction function called to populate the builder + * @return + */ + public static ScriptData of(Function builderFunction) { + + Assert.notNull(builderFunction, "builderFunction must not be null"); + + return builderFunction.apply(new Builder()).build(); + } + + /** + * @since 5.2 + */ + public static Builder builder() { + return new Builder(); + } + + /** + * @since 5.2 + */ + public static final class Builder { + @Nullable + private String language; + @Nullable + private String script; + @Nullable + private String scriptName; + @Nullable + private Map params; + + private Builder() { + } + + public Builder withLanguage(@Nullable String language) { + this.language = language; + return this; + } + + public Builder withScript(@Nullable String script) { + this.script = script; + return this; + } + + public Builder withScriptName(@Nullable String scriptName) { + this.scriptName = scriptName; + return this; + } + + public Builder withParams(@Nullable Map params) { + this.params = params; + return this; + } + + public ScriptData build() { + return new ScriptData(language, script, scriptName, params); + } + } } diff --git a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java index b1f35896b..1f29c6c22 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/script/Script.java @@ -28,6 +28,7 @@ public record Script(String id, String language, String source) { Assert.notNull(id, "id must not be null"); Assert.notNull(language, "language must not be null"); + Assert.notNull(source, "source must not be null"); } public static ScriptBuilder builder() { @@ -60,6 +61,8 @@ public ScriptBuilder withLanguage(String language) { public ScriptBuilder withSource(String source) { + Assert.notNull(source, "source must not be null"); + this.source = source; return this; } From 7f53944e1b51f5bd044b5da9b0b0002ed3d1f7fb Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 12 Jun 2025 09:14:22 +0200 Subject: [PATCH 130/131] Adapt to generics changes in `CoroutineCrudRepository`. Closes #3118 --- .../repository/CoroutineElasticsearchRepository.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt b/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt index 221db17db..79c932fea 100644 --- a/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt +++ b/src/main/kotlin/org/springframework/data/elasticsearch/repository/CoroutineElasticsearchRepository.kt @@ -24,4 +24,4 @@ import org.springframework.data.repository.kotlin.CoroutineSortingRepository * @since 5.2 */ @NoRepositoryBean -interface CoroutineElasticsearchRepository : CoroutineCrudRepository, CoroutineSortingRepository +interface CoroutineElasticsearchRepository : CoroutineCrudRepository, CoroutineSortingRepository From f9509f26965235880c92b6a058d2b4ea8ceb7bdf Mon Sep 17 00:00:00 2001 From: Peter-Josef Meisch Date: Sat, 14 Jun 2025 17:30:22 +0200 Subject: [PATCH 131/131] Upgrade to Elasticsearch 9.0.2. Original Pull Request #3122 Closes #3121 Signed-off-by: Peter-Josef Meisch --- pom.xml | 2 +- .../modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc | 4 ++-- .../antora/modules/ROOT/pages/elasticsearch/versions.adoc | 2 +- src/test/resources/testcontainers-elasticsearch.properties | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 4396ce5a6..4fcfd20c4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 4.0.0-SNAPSHOT - 9.0.1 + 9.0.2 0.19.0 2.23.1 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 f1e07dd19..d4a9c565d 100644 --- a/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc +++ b/src/main/antora/modules/ROOT/pages/elasticsearch/elasticsearch-new.adoc @@ -2,11 +2,11 @@ = What's new [[new-features.6-0-0]] -== New in Spring Data Elasticsearch 6.6 +== New in Spring Data Elasticsearch 6.0 * Upgarde to Spring 7 * Switch to jspecify nullability annotations -* Upgrade to Elasticsearch 9.0.1 +* Upgrade to Elasticsearch 9.0.2 [[new-features.5-5-0]] diff --git a/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc b/src/main/antora/modules/ROOT/pages/elasticsearch/versions.adoc index 8fb6d7261..861e2ff3b 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.1 (in development) | 6.0.x | 9.0.1 | 7.0.x +| 2025.1 (in development) | 6.0.x | 9.0.2 | 7.0.x | 2025.0 | 5.5.x | 8.18.1 | 6.2.x | 2024.1 | 5.4.x | 8.15.5 | 6.1.x | 2024.0 | 5.3.xfootnote:oom[Out of maintenance] | 8.13.4 | 6.1.x diff --git a/src/test/resources/testcontainers-elasticsearch.properties b/src/test/resources/testcontainers-elasticsearch.properties index a16e4a2af..8784f82c3 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=9.0.1 +sde.testcontainers.image-version=9.0.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