Upgrade to Elasticsearch 8.3.3.

Original Pull Request #2244
Closes #2242
This commit is contained in:
Peter-Josef Meisch 2022-07-30 18:34:22 +02:00 committed by GitHub
parent 1f1076aa8b
commit 7620222f89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 29 deletions

View File

@ -21,7 +21,7 @@
<!-- version of the RestHighLevelClient -->
<elasticsearch-rhlc>7.17.5</elasticsearch-rhlc>
<!-- version of the new ElasticsearchClient -->
<elasticsearch-java>8.3.2</elasticsearch-java>
<elasticsearch-java>8.3.3</elasticsearch-java>
<log4j>2.17.2</log4j>
<netty>4.1.65.Final</netty>

View File

@ -37,7 +37,7 @@ built and tested.
[cols="^,^,^,^,^",options="header"]
|===
| Spring Data Release Train | Spring Data Elasticsearch | Elasticsearch | Spring Framework | Spring Boot
| 2022.0 (Turing) | 5.0.x | 8.3.2 | 6.0.x | 3.0.x?
| 2022.0 (Turing) | 5.0.x | 8.3.3 | 6.0.x | 3.0.x?
| 2021.2 (Raj) | 4.4.x | 7.17.3 | 5.3.x | 2.7.x
| 2021.1 (Q) | 4.3.x | 7.15.2 | 5.3.x | 2.6.x
| 2021.0 (Pascal) | 4.2.xfootnote:oom[Out of maintenance] | 7.12.0 | 5.3.x | 2.5.x

View File

@ -122,4 +122,4 @@ your application as Spring Data Elasticsearch does not pull it in automatically
----
====
Make sure to specify the version 7.17.5 explicitly, otherwise maven will resolve to 8.3.2, and this does not exist.
Make sure to specify the version 7.17.5 explicitly, otherwise maven will resolve to 8.3.3, and this does not exist.

View File

@ -17,7 +17,13 @@ package org.springframework.data.elasticsearch.client.elc;
import co.elastic.clients.elasticsearch._types.aggregations.Aggregate;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import co.elastic.clients.elasticsearch.core.search.*;
import co.elastic.clients.elasticsearch.core.search.CompletionSuggest;
import co.elastic.clients.elasticsearch.core.search.CompletionSuggestOption;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.elasticsearch.core.search.HitsMetadata;
import co.elastic.clients.elasticsearch.core.search.ResponseBody;
import co.elastic.clients.elasticsearch.core.search.Suggestion;
import co.elastic.clients.elasticsearch.core.search.TotalHits;
import co.elastic.clients.json.JsonpMapper;
import java.util.ArrayList;
@ -173,12 +179,13 @@ class SearchDocumentResponseBuilder {
List<TermSuggestion.Entry> entries = new ArrayList<>();
suggestionsES.forEach(suggestionES -> {
TermSuggest termSuggest = suggestionES.term();
TermSuggestOption optionES = termSuggest.options();
var termSuggest = suggestionES.term();
var termSuggestOptions = termSuggest.options();
List<TermSuggestion.Entry.Option> options = new ArrayList<>();
options.add(new TermSuggestion.Entry.Option(optionES.text(), null, optionES.score(), null,
Math.toIntExact(optionES.freq())));
termSuggestOptions.forEach(optionES -> {
options.add(new TermSuggestion.Entry.Option(optionES.text(), null, optionES.score(), null,
Math.toIntExact(optionES.freq())));
});
entries.add(new TermSuggestion.Entry(termSuggest.text(), termSuggest.offset(), termSuggest.length(), options));
});
return new TermSuggestion(name, suggestionsES.size(), entries, null);
@ -188,10 +195,12 @@ class SearchDocumentResponseBuilder {
List<PhraseSuggestion.Entry> entries = new ArrayList<>();
suggestionsES.forEach(suggestionES -> {
PhraseSuggest phraseSuggest = suggestionES.phrase();
PhraseSuggestOption optionES = phraseSuggest.options();
var phraseSuggest = suggestionES.phrase();
var phraseSuggestOptions = phraseSuggest.options();
List<PhraseSuggestion.Entry.Option> options = new ArrayList<>();
options.add(new PhraseSuggestion.Entry.Option(optionES.text(), optionES.highlighted(), null, null));
phraseSuggestOptions.forEach(optionES -> {
options.add(new PhraseSuggestion.Entry.Option(optionES.text(), optionES.highlighted(), null, null));
});
entries.add(new PhraseSuggestion.Entry(phraseSuggest.text(), phraseSuggest.offset(), phraseSuggest.length(),
options, null));
});

View File

@ -15,7 +15,7 @@
#
#
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
sde.testcontainers.image-version=8.3.2
sde.testcontainers.image-version=8.3.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