Skip to content

Commit d6e966e

Browse files
authored
Adapt to Elasticsearch 7.16.0.
Original Pull Request #2022 Closes #2020
1 parent 6823a18 commit d6e966e

File tree

11 files changed

+45
-31
lines changed

11 files changed

+45
-31
lines changed

Diff for: pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
1919

2020
<properties>
21-
<elasticsearch>7.15.2</elasticsearch>
21+
<elasticsearch>7.16.0</elasticsearch>
2222
<log4j>2.14.1</log4j>
2323
<netty>4.1.65.Final</netty>
2424
<springdata.commons>2.7.0-SNAPSHOT</springdata.commons>

Diff for: src/main/asciidoc/preface.adoc

+6-5
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ The following table shows the Elasticsearch versions that are used by Spring Dat
3434
[cols="^,^,^,^,^",options="header"]
3535
|===
3636
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework | Spring Boot
37-
| 2021.1 (Q)footnote:cdv[Currently in development] | 4.3.xfootnote:cdv[] | 7.15.2 | 5.3.xfootnote:cdv[] | 2.5 .xfootnote:cdv[]
37+
| 2022.0 (Raj) | 4.4.x | 7.16.0 | 5.3.x |
38+
| 2021.1 (Q) | 4.3.x | 7.15.2 | 5.3.x | 2.6.x
3839
| 2021.0 (Pascal) | 4.2.x | 7.12.0 | 5.3.x | 2.5.x
39-
| 2020.0 (Ockham) | 4.1.x | 7.9.3 | 5.3.2 | 2.4.x
40-
| Neumann | 4.0.x | 7.6.2 | 5.2.12 |2.3.x
41-
| Moore | 3.2.x |6.8.12 | 5.2.12| 2.2.x
42-
| Lovelacefootnote:oom[Out of maintenance] | 3.1.xfootnote:oom[] | 6.2.2 | 5.1.19 |2.1.x
40+
| 2020.0 (Ockham)footnote:oom[Out of maintenance] | 4.1.xfootnote:oom[] | 7.9.3 | 5.3.2 | 2.4.x
41+
| Neumannfootnote:oom[] | 4.0.xfootnote:oom[] | 7.6.2 | 5.2.12 |2.3.x
42+
| Moorefootnote:oom[] | 3.2.xfootnote:oom[] |6.8.12 | 5.2.12| 2.2.x
43+
| Lovelacefootnote:oom[] | 3.1.xfootnote:oom[] | 6.2.2 | 5.1.19 |2.1.x
4344
| Kayfootnote:oom[] | 3.0.xfootnote:oom[] | 5.5.0 | 5.0.13 | 2.0.x
4445
| Ingallsfootnote:oom[] | 2.1.xfootnote:oom[] | 2.4.0 | 4.3.25 | 1.5.x
4546
|===

Diff for: src/main/asciidoc/reference/elasticsearch-new.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[[new-features]]
22
= What's new
33

4+
[[new-features.4-4-0]]
5+
== New in Spring Data Elasticsearch 4.4
6+
7+
* Upgrade to Elasticsearch 7.16.0.
8+
49
[[new-features.4-3-0]]
510
== New in Spring Data Elasticsearch 4.3
611

Diff for: src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/client/reactive/DefaultReactiveElasticsearchClient.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@
8383
import org.elasticsearch.client.GetAliasesResponse;
8484
import org.elasticsearch.client.Request;
8585
import org.elasticsearch.client.indices.*;
86-
import org.elasticsearch.common.xcontent.DeprecationHandler;
87-
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
88-
import org.elasticsearch.common.xcontent.XContentParser;
89-
import org.elasticsearch.common.xcontent.XContentType;
9086
import org.elasticsearch.core.TimeValue;
9187
import org.elasticsearch.index.get.GetResult;
9288
import org.elasticsearch.index.reindex.BulkByScrollResponse;
@@ -100,6 +96,10 @@
10096
import org.elasticsearch.search.SearchHits;
10197
import org.elasticsearch.search.aggregations.Aggregation;
10298
import org.elasticsearch.search.suggest.Suggest;
99+
import org.elasticsearch.xcontent.DeprecationHandler;
100+
import org.elasticsearch.xcontent.NamedXContentRegistry;
101+
import org.elasticsearch.xcontent.XContentParser;
102+
import org.elasticsearch.xcontent.XContentType;
103103
import org.reactivestreams.Publisher;
104104
import org.springframework.data.elasticsearch.RestStatusException;
105105
import org.springframework.data.elasticsearch.UncategorizedElasticsearchException;

Diff for: src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/client/util/NamedXContents.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
import org.elasticsearch.client.analytics.ParsedTopMetrics;
2727
import org.elasticsearch.client.analytics.StringStatsAggregationBuilder;
2828
import org.elasticsearch.client.analytics.TopMetricsAggregationBuilder;
29-
import org.elasticsearch.common.xcontent.ContextParser;
30-
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
31-
import org.elasticsearch.common.xcontent.ParseField;
3229
import org.elasticsearch.search.aggregations.Aggregation;
3330
import org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregationBuilder;
3431
import org.elasticsearch.search.aggregations.bucket.adjacency.ParsedAdjacencyMatrix;
@@ -78,6 +75,9 @@
7875
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder;
7976
import org.elasticsearch.search.suggest.term.TermSuggestion;
8077
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder;
78+
import org.elasticsearch.xcontent.ContextParser;
79+
import org.elasticsearch.xcontent.NamedXContentRegistry;
80+
import org.elasticsearch.xcontent.ParseField;
8181
import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient;
8282

8383
/**

Diff for: src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/client/util/RequestConverters.java

+13-8
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,7 @@
8080
import org.elasticsearch.common.Strings;
8181
import org.elasticsearch.common.bytes.BytesReference;
8282
import org.elasticsearch.common.lucene.uid.Versions;
83-
import org.elasticsearch.common.xcontent.DeprecationHandler;
84-
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
85-
import org.elasticsearch.common.xcontent.ToXContent;
86-
import org.elasticsearch.common.xcontent.XContent;
87-
import org.elasticsearch.common.xcontent.XContentBuilder;
8883
import org.elasticsearch.common.xcontent.XContentHelper;
89-
import org.elasticsearch.common.xcontent.XContentParser;
90-
import org.elasticsearch.common.xcontent.XContentType;
9184
import org.elasticsearch.core.SuppressForbidden;
9285
import org.elasticsearch.core.TimeValue;
9386
import org.elasticsearch.index.VersionType;
@@ -101,6 +94,13 @@
10194
import org.elasticsearch.script.mustache.SearchTemplateRequest;
10295
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
10396
import org.elasticsearch.tasks.TaskId;
97+
import org.elasticsearch.xcontent.DeprecationHandler;
98+
import org.elasticsearch.xcontent.NamedXContentRegistry;
99+
import org.elasticsearch.xcontent.ToXContent;
100+
import org.elasticsearch.xcontent.XContent;
101+
import org.elasticsearch.xcontent.XContentBuilder;
102+
import org.elasticsearch.xcontent.XContentParser;
103+
import org.elasticsearch.xcontent.XContentType;
104104
import org.springframework.data.elasticsearch.backend.elasticsearch7.client.reactive.ReactiveElasticsearchClient;
105105
import org.springframework.http.HttpMethod;
106106
import org.springframework.lang.Nullable;
@@ -1232,7 +1232,12 @@ Params withWaitForActiveShards(ActiveShardCount activeShardCount, ActiveShardCou
12321232
return this;
12331233
}
12341234

1235-
Params withIndicesOptions(IndicesOptions indicesOptions) {
1235+
Params withIndicesOptions(@Nullable IndicesOptions indicesOptions) {
1236+
1237+
if (indicesOptions == null) {
1238+
return this;
1239+
}
1240+
12361241
withIgnoreUnavailable(indicesOptions.ignoreUnavailable());
12371242
putParam("allow_no_indices", Boolean.toString(indicesOptions.allowNoIndices()));
12381243
String expandWildcards;

Diff for: src/test/java/org/springframework/data/elasticsearch/backend/elasticsearch7/RequestFactoryTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
3232
import org.elasticsearch.common.lucene.search.function.CombineFunction;
3333
import org.elasticsearch.common.lucene.search.function.FunctionScoreQuery;
34-
import org.elasticsearch.common.xcontent.ToXContent;
3534
import org.elasticsearch.common.xcontent.XContentHelper;
36-
import org.elasticsearch.common.xcontent.XContentType;
3735
import org.elasticsearch.index.query.QueryBuilders;
3836
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
3937
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder;
4038
import org.elasticsearch.index.query.functionscore.GaussDecayFunctionBuilder;
39+
import org.elasticsearch.xcontent.ToXContent;
40+
import org.elasticsearch.xcontent.XContentType;
4141
import org.json.JSONException;
4242
import org.junit.jupiter.api.BeforeAll;
4343
import org.junit.jupiter.api.DisplayName;

Diff for: src/test/java/org/springframework/data/elasticsearch/backend/elasticsearch7/client/reactive/ReactiveElasticsearchClientUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
import org.elasticsearch.action.index.IndexRequest;
3636
import org.elasticsearch.action.search.SearchRequest;
3737
import org.elasticsearch.action.update.UpdateRequest;
38-
import org.elasticsearch.common.xcontent.XContentType;
3938
import org.elasticsearch.core.TimeValue;
4039
import org.elasticsearch.index.VersionType;
4140
import org.elasticsearch.rest.RestStatus;
4241
import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms;
4342
import org.elasticsearch.search.aggregations.metrics.ParsedMax;
43+
import org.elasticsearch.xcontent.XContentType;
4444
import org.junit.jupiter.api.BeforeEach;
4545
import org.junit.jupiter.api.Test;
4646
import org.mockito.Mockito;

Diff for: src/test/java/org/springframework/data/elasticsearch/core/DocumentAdaptersUnitTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void shouldAdaptSearchResponse() {
142142
Map<String, DocumentField> fields = Collections.singletonMap("field",
143143
new DocumentField("field", Collections.singletonList("value")));
144144

145-
SearchShardTarget shard = new SearchShardTarget("node", new ShardId("index", "uuid", 42), null, null);
145+
SearchShardTarget shard = new SearchShardTarget("node", new ShardId("index", "uuid", 42), null);
146146
SearchHit searchHit = new SearchHit(123, "my-id", new Text("type"), null, fields);
147147
searchHit.shard(shard);
148148
searchHit.setSeqNo(1);
@@ -217,7 +217,7 @@ public void shouldAdaptSearchResponseSource() {
217217

218218
BytesArray source = new BytesArray("{\"field\":\"value\"}");
219219

220-
SearchShardTarget shard = new SearchShardTarget("node", new ShardId("index", "uuid", 42), null, null);
220+
SearchShardTarget shard = new SearchShardTarget("node", new ShardId("index", "uuid", 42), null);
221221
SearchHit searchHit = new SearchHit(123, "my-id", new Text("type"), null, null);
222222
searchHit.shard(shard);
223223
searchHit.sourceRef(source).score(42);

Diff for: src/test/java/org/springframework/data/elasticsearch/core/suggest/CompletionWithContextsIntegrationTests.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525

2626
import org.elasticsearch.action.search.SearchResponse;
2727
import org.elasticsearch.common.unit.Fuzziness;
28-
import org.elasticsearch.common.xcontent.ToXContent;
2928
import org.elasticsearch.search.suggest.SuggestBuilder;
3029
import org.elasticsearch.search.suggest.SuggestBuilders;
3130
import org.elasticsearch.search.suggest.SuggestionBuilder;
3231
import org.elasticsearch.search.suggest.completion.CompletionSuggestion;
3332
import org.elasticsearch.search.suggest.completion.CompletionSuggestionBuilder;
3433
import org.elasticsearch.search.suggest.completion.context.CategoryQueryContext;
34+
import org.elasticsearch.xcontent.ToXContent;
3535
import org.junit.jupiter.api.AfterEach;
3636
import org.junit.jupiter.api.BeforeEach;
3737
import org.junit.jupiter.api.Test;
@@ -207,7 +207,8 @@ public void shouldFindSuggestionsForGivenCriteriaQueryUsingContextCompletionEnti
207207
*/
208208
static class NonDocumentEntity {
209209

210-
@Nullable @Id private String someId;
210+
@Nullable
211+
@Id private String someId;
211212
@Nullable private String someField1;
212213
@Nullable private String someField2;
213214

@@ -238,10 +239,12 @@ public void setSomeField2(String someField2) {
238239
static class ContextCompletionEntity {
239240

240241
public static final String LANGUAGE_CATEGORY = "language";
241-
@Nullable @Id private String id;
242+
@Nullable
243+
@Id private String id;
242244
@Nullable private String name;
243245

244-
@Nullable @CompletionField(maxInputLength = 100, contexts = { @CompletionContext(name = LANGUAGE_CATEGORY,
246+
@Nullable
247+
@CompletionField(maxInputLength = 100, contexts = { @CompletionContext(name = LANGUAGE_CATEGORY,
245248
type = CompletionContext.ContextMappingType.CATEGORY) }) private Completion suggest;
246249

247250
private ContextCompletionEntity() {}

Diff for: src/test/resources/testcontainers-elasticsearch.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# properties defining the image, these are not passed to the container on startup
1818
#
1919
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
20-
sde.testcontainers.image-version=7.15.2
20+
sde.testcontainers.image-version=7.16.0
2121
#
2222
#
2323
# 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

0 commit comments

Comments
 (0)