mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-06 18:52:11 +00:00
upgrade to Elasticsearch 7.14.1.
Original Pull Request #1933 Closes #1892
This commit is contained in:
parent
fa66702980
commit
3128fab595
2
pom.xml
2
pom.xml
@ -18,7 +18,7 @@
|
||||
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
|
||||
|
||||
<properties>
|
||||
<elasticsearch>7.13.4</elasticsearch>
|
||||
<elasticsearch>7.14.1</elasticsearch>
|
||||
<log4j>2.14.1</log4j>
|
||||
<netty>4.1.65.Final</netty>
|
||||
<springdata.commons>2.6.0-SNAPSHOT</springdata.commons>
|
||||
|
@ -83,11 +83,11 @@ import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.client.GetAliasesResponse;
|
||||
import org.elasticsearch.client.Request;
|
||||
import org.elasticsearch.client.indices.*;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.get.GetResult;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||
|
@ -26,9 +26,9 @@ import org.elasticsearch.client.analytics.ParsedStringStats;
|
||||
import org.elasticsearch.client.analytics.ParsedTopMetrics;
|
||||
import org.elasticsearch.client.analytics.StringStatsAggregationBuilder;
|
||||
import org.elasticsearch.client.analytics.TopMetricsAggregationBuilder;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.xcontent.ContextParser;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.ParseField;
|
||||
import org.elasticsearch.search.aggregations.Aggregation;
|
||||
import org.elasticsearch.search.aggregations.bucket.adjacency.AdjacencyMatrixAggregationBuilder;
|
||||
import org.elasticsearch.search.aggregations.bucket.adjacency.ParsedAdjacencyMatrix;
|
||||
|
@ -78,10 +78,8 @@ import org.elasticsearch.client.indices.PutIndexTemplateRequest;
|
||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
import org.elasticsearch.common.Priority;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.SuppressForbidden;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.lucene.uid.Versions;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.DeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -90,6 +88,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.core.SuppressForbidden;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.VersionType;
|
||||
import org.elasticsearch.index.mapper.MapperService;
|
||||
import org.elasticsearch.index.rankeval.RankEvalRequest;
|
||||
|
@ -37,7 +37,7 @@ import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
|
||||
|
@ -40,7 +40,7 @@ import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.action.support.WriteRequestBuilder;
|
||||
import org.elasticsearch.action.update.UpdateRequestBuilder;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||
import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder;
|
||||
import org.elasticsearch.search.suggest.SuggestBuilder;
|
||||
|
@ -70,7 +70,7 @@ import org.elasticsearch.client.indices.PutIndexTemplateRequest;
|
||||
import org.elasticsearch.client.indices.PutMappingRequest;
|
||||
import org.elasticsearch.common.geo.GeoDistance;
|
||||
import org.elasticsearch.common.unit.DistanceUnit;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.VersionType;
|
||||
import org.elasticsearch.index.query.MoreLikeThisQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
|
@ -46,6 +46,7 @@ import com.github.tomakehurst.wiremock.WireMockServer;
|
||||
import com.github.tomakehurst.wiremock.client.WireMock;
|
||||
import com.github.tomakehurst.wiremock.matching.AnythingPattern;
|
||||
import com.github.tomakehurst.wiremock.matching.EqualToPattern;
|
||||
import com.github.tomakehurst.wiremock.stubbing.StubMapping;
|
||||
|
||||
/**
|
||||
* We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient
|
||||
@ -66,6 +67,7 @@ public class RestClientsTest {
|
||||
|
||||
// wiremock is the dummy server, hoverfly the proxy
|
||||
WireMock.configureFor(server.port());
|
||||
stubForElasticsearchVersionCheck();
|
||||
stubFor(head(urlEqualTo("/")).willReturn(aResponse() //
|
||||
.withHeader("Content-Type", "application/json; charset=UTF-8")));
|
||||
|
||||
@ -95,6 +97,7 @@ public class RestClientsTest {
|
||||
|
||||
WireMock.configureFor(server.port());
|
||||
|
||||
stubForElasticsearchVersionCheck();
|
||||
stubFor(head(urlEqualTo("/")).willReturn(aResponse() //
|
||||
.withHeader("Content-Type", "application/json; charset=UTF-8")));
|
||||
|
||||
@ -144,7 +147,8 @@ public class RestClientsTest {
|
||||
.withHeader("def1", new EqualToPattern("def1-2")) //
|
||||
.withHeader("def2", new EqualToPattern("def2-1")) //
|
||||
.withHeader("supplied", new EqualToPattern("val0")) //
|
||||
.withHeader("supplied", new EqualToPattern("val" + i)) //
|
||||
// on the first call Elasticsearch does the version check and thus already increments the counter
|
||||
.withHeader("supplied", new EqualToPattern("val" + (i + 1))) //
|
||||
);
|
||||
}
|
||||
|
||||
@ -152,6 +156,29 @@ public class RestClientsTest {
|
||||
});
|
||||
}
|
||||
|
||||
private StubMapping stubForElasticsearchVersionCheck() {
|
||||
return stubFor(get(urlEqualTo("/")) //
|
||||
.willReturn(okJson("{\n" + //
|
||||
" \"cluster_name\": \"docker-cluster\",\n" + //
|
||||
" \"cluster_uuid\": \"nKasrfHjRo6ge0eBmMUuAQ\",\n" + //
|
||||
" \"name\": \"c1a6e517d001\",\n" + //
|
||||
" \"tagline\": \"You Know, for Search\",\n" + //
|
||||
" \"version\": {\n" + //
|
||||
" \"build_date\": \"2021-08-26T09:01:05.390870785Z\",\n" + //
|
||||
" \"build_flavor\": \"default\",\n" + //
|
||||
" \"build_hash\": \"66b55ebfa59c92c15db3f69a335d500018b3331e\",\n" + //
|
||||
" \"build_snapshot\": false,\n" + //
|
||||
" \"build_type\": \"docker\",\n" + //
|
||||
" \"lucene_version\": \"8.9.0\",\n" + //
|
||||
" \"minimum_index_compatibility_version\": \"6.0.0-beta1\",\n" + //
|
||||
" \"minimum_wire_compatibility_version\": \"6.8.0\",\n" + //
|
||||
" \"number\": \"7.14.1\"\n" + //
|
||||
" }\n" + //
|
||||
"}") //
|
||||
.withHeader("Content-Type", "application/json; charset=UTF-8") //
|
||||
.withHeader("X-Elastic-Product", "Elasticsearch")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumer extension that catches checked exceptions and wraps them in a RuntimeException.
|
||||
*/
|
||||
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import org.elasticsearch.ElasticsearchStatusException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
|
||||
import org.elasticsearch.action.bulk.BulkRequest;
|
||||
import org.elasticsearch.action.delete.DeleteRequest;
|
||||
@ -43,7 +42,7 @@ import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.client.indices.CreateIndexRequest;
|
||||
import org.elasticsearch.client.indices.GetIndexRequest;
|
||||
import org.elasticsearch.client.indices.GetMappingsRequest;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.index.reindex.BulkByScrollResponse;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||
@ -157,7 +156,7 @@ public class ReactiveElasticsearchClientIntegrationTests {
|
||||
public void infoShouldReturnClusterInformation() {
|
||||
|
||||
client.info().as(StepVerifier::create) //
|
||||
.consumeNextWith(it -> assertThat(it.getVersion()).isGreaterThanOrEqualTo(Version.CURRENT)) //
|
||||
.consumeNextWith(it -> assertThat(it.getVersion()).isNotNull()) //
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,8 @@ import org.elasticsearch.action.get.MultiGetRequest;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.VersionType;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.ParsedStringTerms;
|
||||
|
@ -28,7 +28,7 @@ import java.util.Map;
|
||||
import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
|
||||
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
||||
import org.json.JSONException;
|
||||
|
@ -38,7 +38,7 @@ import org.elasticsearch.action.search.SearchScrollRequestBuilder;
|
||||
import org.elasticsearch.action.search.SearchType;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
|
@ -32,7 +32,7 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.action.update.UpdateRequestBuilder;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.engine.DocumentMissingException;
|
||||
import org.elasticsearch.index.reindex.UpdateByQueryRequestBuilder;
|
||||
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
|
||||
|
@ -17,7 +17,7 @@
|
||||
# properties defining the image, these are not passed to the container on startup
|
||||
#
|
||||
sde.testcontainers.image-name=docker.elastic.co/elasticsearch/elasticsearch
|
||||
sde.testcontainers.image-version=7.13.4
|
||||
sde.testcontainers.image-version=7.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
|
||||
|
Loading…
x
Reference in New Issue
Block a user