diff --git a/pom.xml b/pom.xml index 0c5456856..2f0228ae5 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 2.6 - 6.8.1 + 7.3.0 2.9.1 2.3.0.BUILD-SNAPSHOT 4.1.39.Final 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 e2ce9e59c..629d2a433 100644 --- a/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java +++ b/src/main/java/org/springframework/data/elasticsearch/annotations/Document.java @@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.elasticsearch.index.VersionType; - import org.springframework.data.annotation.Persistent; /** @@ -33,6 +32,7 @@ import org.springframework.data.annotation.Persistent; * @author Mason Chan * @author Ivan Greene * @author Mark Paluch + * @author Peter-Josef Meisch */ @Persistent @Inherited @@ -54,8 +54,14 @@ public @interface Document { String indexName(); /** - * Mapping type name. + * Mapping type name.
+ * deprecated as Elasticsearch does not support this anymore + * (@see Elastisearch removal of types documentation) and will remove it in + * Elasticsearch 8. + * + * @deprecated since 4.0 */ + @Deprecated String type() default ""; /** @@ -64,9 +70,11 @@ public @interface Document { boolean useServerConfiguration() default false; /** - * Number of shards for the index {@link #indexName()}. Used for index creation. + * Number of shards for the index {@link #indexName()}. Used for index creation.
+ * With version 4.0, the default value is changed from 5 to 1 to reflect the change in the default settings of + * Elasticsearch which changed to 1 as well in Elasticsearch 7.0. */ - short shards() default 5; + short shards() default 1; /** * Number of replicas for the index {@link #indexName()}. Used for index creation. diff --git a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java index 05ee9042c..28b0256c6 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/NodeClientFactoryBean.java @@ -20,6 +20,7 @@ import static java.util.Arrays.*; import java.io.IOException; import java.io.InputStream; import java.util.Collection; +import java.util.Collections; import org.elasticsearch.client.Client; import org.elasticsearch.client.node.NodeClient; @@ -42,6 +43,7 @@ import org.springframework.util.StringUtils; * @author Rizwan Idrees * @author Mohsin Husen * @author Ilkang Na + * @author Peter-Josef Meisch */ public class NodeClientFactoryBean implements FactoryBean, InitializingBean, DisposableBean { @@ -56,14 +58,17 @@ public class NodeClientFactoryBean implements FactoryBean, InitializingB public static class TestNode extends Node { + private static final String DEFAULT_NODE_NAME = "spring-data-elasticsearch-test-node"; + public TestNode(Settings preparedSettings, Collection> classpathPlugins) { - super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins, false); + super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, Collections.emptyMap(), null, + () -> DEFAULT_NODE_NAME), classpathPlugins, false); } protected void registerDerivedNodeNameWithLogger(String nodeName) { try { - LogConfigurator.setNodeName(nodeName); + LogConfigurator.setNodeName(nodeName); } catch (Exception e) { // nagh - just forget about it } diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java index 99e68ab85..b93ef14f7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/DefaultReactiveElasticsearchClient.java @@ -122,6 +122,7 @@ import org.springframework.web.reactive.function.client.WebClient.RequestBodySpe * * @author Christoph Strobl * @author Mark Paluch + * @author Peter-Josef Meisch * @since 3.2 * @see ClientConfiguration * @see ReactiveRestClients @@ -548,7 +549,7 @@ public class DefaultReactiveElasticsearchClient implements ReactiveElasticsearch return new GetResult(response.getIndex(), response.getType(), response.getId(), response.getSeqNo(), response.getPrimaryTerm(), response.getVersion(), response.isExists(), response.getSourceAsBytesRef(), - response.getFields()); + response.getFields(), null); } // --> diff --git a/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java b/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java index 0163e01c6..47d1f26df 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/util/RequestConverters.java @@ -33,7 +33,6 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest; import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest; import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; -import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.close.CloseIndexRequest; import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; @@ -60,6 +59,7 @@ import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.Request; import org.elasticsearch.client.Requests; import org.elasticsearch.client.RethrottleRequest; +import org.elasticsearch.client.indices.AnalyzeRequest; import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.common.Priority; import org.elasticsearch.common.Strings; @@ -98,6 +98,8 @@ import org.springframework.lang.Nullable; *

* Only intended for internal use. * + * @author Christoph Strobl + * @author Peter-Josef Meisch * @since 3.2 */ public class RequestConverters { @@ -718,10 +720,10 @@ public class RequestConverters { Request request = new Request(HttpMethod.PUT.name(), RequestConverters.endpoint(putMappingRequest.indices(), "_mapping", putMappingRequest.type())); - RequestConverters.Params parameters = new RequestConverters.Params(request); - parameters.withTimeout(putMappingRequest.timeout()); - parameters.withMasterTimeout(putMappingRequest.masterNodeTimeout()); - + RequestConverters.Params parameters = new RequestConverters.Params(request) // + .withTimeout(putMappingRequest.timeout()) // + .withMasterTimeout(putMappingRequest.masterNodeTimeout()) // + .withIncludeTypeName(true); request.setEntity(RequestConverters.createEntity(putMappingRequest, RequestConverters.REQUEST_BODY_CONTENT_TYPE)); return request; } @@ -942,7 +944,10 @@ public class RequestConverters { Params withWaitForActiveShards(ActiveShardCount activeShardCount, ActiveShardCount defaultActiveShardCount) { if (activeShardCount != null && activeShardCount != defaultActiveShardCount) { - return putParam("wait_for_active_shards", activeShardCount.toString().toLowerCase(Locale.ROOT)); + // in Elasticsearch 7, "default" cannot be sent anymore, so it needs to be mapped to the default value of 1 + String value = activeShardCount == ActiveShardCount.DEFAULT ? "1" + : activeShardCount.toString().toLowerCase(Locale.ROOT); + return putParam("wait_for_active_shards", value); } return this; } @@ -1082,6 +1087,18 @@ public class RequestConverters { } return this; } + + /** + * sets the include_type_name parameter. Needed for Elasticsearch 7 to be used with the mapping types still + * available. Will be removed again when Elasticsearch drops the support for this parameter in Elasticsearch 8. + * + * @deprecated since 4.0 + * @since 4.0 + */ + @Deprecated + Params withIncludeTypeName(boolean includeTypeName) { + return putParam("include_type_name", String.valueOf(includeTypeName)); + } } /** diff --git a/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java b/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java index 162a1bb8d..762076f7c 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/DefaultResultMapper.java @@ -28,7 +28,6 @@ import org.elasticsearch.action.get.MultiGetResponse; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.document.DocumentField; import org.elasticsearch.search.SearchHit; - import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.data.domain.Pageable; @@ -40,6 +39,7 @@ import org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPa import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity; import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; +import org.springframework.data.elasticsearch.support.SearchHitsUtil; import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.context.MappingContext; import org.springframework.data.mapping.model.ConvertingPropertyAccessor; @@ -99,7 +99,7 @@ public class DefaultResultMapper extends AbstractResultMapper { @Override public AggregatedPage mapResults(SearchResponse response, Class clazz, Pageable pageable) { - long totalHits = response.getHits().getTotalHits(); + long totalHits = SearchHitsUtil.getTotalCount(response.getHits()); float maxScore = response.getHits().getMaxScore(); List results = new ArrayList<>(); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java index 48becc952..37f1811f9 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplate.java @@ -56,6 +56,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchScrollRequest; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.action.update.UpdateResponse; +import org.elasticsearch.client.Request; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.Requests; import org.elasticsearch.client.Response; @@ -104,6 +105,7 @@ import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersiste import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.core.query.*; +import org.springframework.data.elasticsearch.support.SearchHitsUtil; import org.springframework.data.util.CloseableIterator; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -302,7 +304,8 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate Map mappings = null; RestClient restClient = client.getLowLevelClient(); try { - Response response = restClient.performRequest("GET", "/" + indexName + "/_mapping/" + type); + Request request = new Request("GET", '/' + indexName + "/_mapping/" + type + "?include_type_name=true"); + Response response = restClient.performRequest(request); mappings = convertMappingResponse(EntityUtils.toString(response.getEntity()), type); } catch (Exception e) { throw new ElasticsearchException( @@ -601,7 +604,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate countRequest.source(sourceBuilder); try { - return client.search(countRequest, RequestOptions.DEFAULT).getHits().getTotalHits(); + return SearchHitsUtil.getTotalCount(client.search(countRequest, RequestOptions.DEFAULT).getHits()); } catch (IOException e) { throw new ElasticsearchException("Error while searching for request: " + countRequest.toString(), e); } @@ -622,7 +625,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate } catch (IOException e) { throw new ElasticsearchException("Error for search request: " + searchRequest.toString(), e); } - return response.getHits().getTotalHits(); + return SearchHitsUtil.getTotalCount(response.getHits()); } private SearchRequest prepareCount(Query query, Class clazz) { @@ -844,7 +847,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate public boolean typeExists(String index, String type) { RestClient restClient = client.getLowLevelClient(); try { - Response response = restClient.performRequest("HEAD", index + "/_mapping/" + type); + Response response = restClient.performRequest(new Request("HEAD", index + "/_mapping/" + type)); return (response.getStatusLine().getStatusCode() == 200); } catch (Exception e) { throw new ElasticsearchException("Error while checking type exists for index: " + index + " type : " + type + " ", @@ -1272,7 +1275,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate Map settings = null; RestClient restClient = client.getLowLevelClient(); try { - Response response = restClient.performRequest("GET", "/" + indexName + "/_settings"); + Response response = restClient.performRequest(new Request("GET", "/" + indexName + "/_settings")); settings = convertSettingResponse(EntityUtils.toString(response.getEntity()), indexName); } catch (Exception e) { @@ -1432,10 +1435,6 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate indexRequest.versionType(versionType); } - if (query.getParentId() != null) { - indexRequest.parent(query.getParentId()); - } - return indexRequest; } catch (IOException e) { throw new ElasticsearchException("failed to index the document [id: " + query.getId() + "]", e); @@ -1466,7 +1465,7 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate String aliasResponse; try { - response = restClient.performRequest("GET", "/" + indexName + "/_alias/*"); + response = restClient.performRequest(new Request("GET", "/" + indexName + "/_alias/*")); aliasResponse = EntityUtils.toString(response.getEntity()); } catch (Exception e) { throw new ElasticsearchException("Error while getting mapping for indexName : " + indexName, e); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java index e71727c0b..ddadeb8f9 100755 --- a/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplate.java @@ -92,6 +92,7 @@ import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersiste import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty; import org.springframework.data.elasticsearch.core.mapping.SimpleElasticsearchMappingContext; import org.springframework.data.elasticsearch.core.query.*; +import org.springframework.data.elasticsearch.support.SearchHitsUtil; import org.springframework.data.util.CloseableIterator; import org.springframework.lang.Nullable; import org.springframework.util.Assert; @@ -508,7 +509,7 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate if (elasticsearchQuery != null) { countRequestBuilder.setQuery(elasticsearchQuery); } - return countRequestBuilder.execute().actionGet().getHits().getTotalHits(); + return SearchHitsUtil.getTotalCount(countRequestBuilder.execute().actionGet().getHits()); } private long doCount(SearchRequestBuilder searchRequestBuilder, QueryBuilder elasticsearchQuery, @@ -521,7 +522,7 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate if (elasticsearchFilter != null) { searchRequestBuilder.setPostFilter(elasticsearchFilter); } - return searchRequestBuilder.execute().actionGet().getHits().getTotalHits(); + return SearchHitsUtil.getTotalCount(searchRequestBuilder.execute().actionGet().getHits()); } private SearchRequestBuilder prepareCount(Query query, Class clazz) { @@ -1202,10 +1203,6 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate indexRequestBuilder.setVersionType(versionType); } - if (query.getParentId() != null) { - indexRequestBuilder.setParent(query.getParentId()); - } - return indexRequestBuilder; } catch (IOException e) { throw new ElasticsearchException("failed to index the document [id: " + query.getId() + "]", e); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java index 014254e77..bd47f5df7 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/FacetedPageImpl.java @@ -15,18 +15,21 @@ */ package org.springframework.data.elasticsearch.core; +import static java.util.Optional.*; + +import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.elasticsearch.search.aggregations.Aggregation; import org.elasticsearch.search.aggregations.Aggregations; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.bucket.range.Range; import org.elasticsearch.search.aggregations.bucket.terms.Terms; -import org.elasticsearch.search.aggregations.metrics.stats.extended.ExtendedStats; -import org.elasticsearch.search.aggregations.metrics.sum.Sum; -import org.joda.time.DateTime; +import org.elasticsearch.search.aggregations.metrics.ExtendedStats; +import org.elasticsearch.search.aggregations.metrics.Sum; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage; @@ -40,8 +43,6 @@ import org.springframework.data.elasticsearch.core.facet.result.StatisticalResul import org.springframework.data.elasticsearch.core.facet.result.Term; import org.springframework.data.elasticsearch.core.facet.result.TermResult; -import static java.util.Optional.ofNullable; - /** * Container for query result and facet results * @@ -51,6 +52,7 @@ import static java.util.Optional.ofNullable; * @author Jonathan Yan * @author Philipp Kräutli * @author Remco Zigterman + * @author Peter-Josef Meisch */ @Deprecated public abstract class FacetedPageImpl extends PageImpl implements FacetedPage, AggregatedPage { @@ -106,8 +108,7 @@ public abstract class FacetedPageImpl extends PageImpl implements FacetedP } } - private void processAggregation(Aggregation agg) - { + private void processAggregation(Aggregation agg) { if (agg instanceof Terms) { processTermAggregation((Terms) agg); } @@ -122,8 +123,7 @@ public abstract class FacetedPageImpl extends PageImpl implements FacetedP } } - private void processTermAggregation(Terms agg) - { + private void processTermAggregation(Terms agg) { List terms = new ArrayList<>(); for (Terms.Bucket t : agg.getBuckets()) { terms.add(new Term(t.getKeyAsString(), t.getDocCount())); @@ -131,36 +131,39 @@ public abstract class FacetedPageImpl extends PageImpl implements FacetedP addFacet(new TermResult(agg.getName(), terms, terms.size(), agg.getSumOfOtherDocCounts(), 0)); } - private void processRangeAggregation(Range agg) - { + private void processRangeAggregation(Range agg) { List buckets = ((Range) agg).getBuckets(); List ranges = new ArrayList<>(); for (Range.Bucket b : buckets) { ExtendedStats rStats = b.getAggregations().get(AbstractFacetRequest.INTERNAL_STATS); if (rStats != null) { Sum sum = b.getAggregations().get(RangeFacetRequest.RANGE_INTERNAL_SUM); - ranges.add(new org.springframework.data.elasticsearch.core.facet.result.Range((Double) b.getFrom(), (Double) b.getTo(), b.getDocCount(), sum != null ? sum.getValue() : rStats.getSum(), rStats.getCount(), rStats.getMin(), rStats.getMax())); + ranges.add(new org.springframework.data.elasticsearch.core.facet.result.Range((Double) b.getFrom(), + (Double) b.getTo(), b.getDocCount(), sum != null ? sum.getValue() : rStats.getSum(), rStats.getCount(), + rStats.getMin(), rStats.getMax())); } else { - ranges.add(new org.springframework.data.elasticsearch.core.facet.result.Range((Double) b.getFrom(), (Double) b.getTo(), b.getDocCount(), 0, 0, 0, 0)); + ranges.add(new org.springframework.data.elasticsearch.core.facet.result.Range((Double) b.getFrom(), + (Double) b.getTo(), b.getDocCount(), 0, 0, 0, 0)); } } addFacet(new RangeResult(agg.getName(), ranges)); } - private void processExtendedStatsAggregation(ExtendedStats agg) - { - addFacet(new StatisticalResult(agg.getName(), agg.getCount(), agg.getMax(), agg.getMin(), agg.getAvg(), agg.getStdDeviation(), agg.getSumOfSquares(), agg.getSum(), agg.getVariance())); + private void processExtendedStatsAggregation(ExtendedStats agg) { + addFacet(new StatisticalResult(agg.getName(), agg.getCount(), agg.getMax(), agg.getMin(), agg.getAvg(), + agg.getStdDeviation(), agg.getSumOfSquares(), agg.getSum(), agg.getVariance())); } - private void processHistogramAggregation(Histogram agg) - { + private void processHistogramAggregation(Histogram agg) { List intervals = new ArrayList<>(); for (Histogram.Bucket h : agg.getBuckets()) { ExtendedStats hStats = h.getAggregations().get(AbstractFacetRequest.INTERNAL_STATS); if (hStats != null) { - intervals.add(new IntervalUnit(((DateTime) h.getKey()).getMillis(), h.getDocCount(), h.getDocCount(), hStats.getSum(), hStats.getAvg(), hStats.getMin(), hStats.getMax())); + intervals.add(new IntervalUnit(((ZonedDateTime) h.getKey()).toInstant().toEpochMilli(), h.getDocCount(), + h.getDocCount(), hStats.getSum(), hStats.getAvg(), hStats.getMin(), hStats.getMax())); } else { - intervals.add(new IntervalUnit(((DateTime) h.getKey()).getMillis(), h.getDocCount(), h.getDocCount(), 0, 0, 0, 0)); + intervals.add(new IntervalUnit(((ZonedDateTime) h.getKey()).toInstant().toEpochMilli(), h.getDocCount(), + h.getDocCount(), 0, 0, 0, 0)); } } addFacet(new HistogramResult(agg.getName(), intervals)); diff --git a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java index eabe68f2f..f89559723 100644 --- a/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java +++ b/src/main/java/org/springframework/data/elasticsearch/core/ReactiveElasticsearchTemplate.java @@ -170,14 +170,6 @@ public class ReactiveElasticsearchTemplate implements ReactiveElasticsearchOpera } } - if (entity.hasParent()) { - - Object parentId = entity.getParentId(); - if (parentId != null) { - request.parent(converter.convertId(parentId)); - } - } - request = prepareIndexRequest(value, request); return doIndex(request); }); 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 6ecec87fb..5790f1ffd 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 @@ -20,6 +20,7 @@ package org.springframework.data.elasticsearch.core.query; * * @author Rizwan Idrees * @author Mohsin Husen + * @author Peter-Josef Meisch */ public class IndexQuery { @@ -84,6 +85,11 @@ public class IndexQuery { return parentId; } + /** + * @deprecated from 4.0. Elasticsearch 7 does not support the parent id in an index request. parent/child relations + * must be modeled using the join datatype. Setting it here will have no effect. + */ + @Deprecated public void setParentId(String parentId) { this.parentId = parentId; } diff --git a/src/main/java/org/springframework/data/elasticsearch/support/SearchHitsUtil.java b/src/main/java/org/springframework/data/elasticsearch/support/SearchHitsUtil.java new file mode 100644 index 000000000..77758ef2a --- /dev/null +++ b/src/main/java/org/springframework/data/elasticsearch/support/SearchHitsUtil.java @@ -0,0 +1,32 @@ +/* + * Copyright 2019 the original author 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.support; + +import org.elasticsearch.search.SearchHits; + +/** + * Utility class to prevent leaking of Lucene API into Spring Data Elasticsearch. + * + * @author Peter-Josef Meisch + * @since 4.0 + */ +public final class SearchHitsUtil { + private SearchHitsUtil() {} + + public static long getTotalCount(SearchHits searchHits) { + return searchHits.getTotalHits().value; + } +} diff --git a/src/main/resources/org/springframework/data/elasticsearch/config/spring-elasticsearch-4.0.xsd b/src/main/resources/org/springframework/data/elasticsearch/config/spring-elasticsearch-4.0.xsd index 0d71a579f..44da837ec 100644 --- a/src/main/resources/org/springframework/data/elasticsearch/config/spring-elasticsearch-4.0.xsd +++ b/src/main/resources/org/springframework/data/elasticsearch/config/spring-elasticsearch-4.0.xsd @@ -11,7 +11,7 @@ + schemaLocation="https://www.springframework.org/schema/data/repository/spring-repository.xsd"/> diff --git a/src/test/java/org/springframework/data/elasticsearch/TestUtils.java b/src/test/java/org/springframework/data/elasticsearch/TestUtils.java index 18e485d33..7e6be5287 100644 --- a/src/test/java/org/springframework/data/elasticsearch/TestUtils.java +++ b/src/test/java/org/springframework/data/elasticsearch/TestUtils.java @@ -31,6 +31,7 @@ import org.springframework.data.elasticsearch.client.ClientConfiguration; import org.springframework.data.elasticsearch.client.RestClients; import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; import org.springframework.data.elasticsearch.client.reactive.ReactiveRestClients; +import org.springframework.data.elasticsearch.support.SearchHitsUtil; import org.springframework.data.util.Version; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; @@ -59,7 +60,8 @@ public final class TestUtils { try (RestHighLevelClient client = restHighLevelClient()) { - org.elasticsearch.Version version = client.info(RequestOptions.DEFAULT).getVersion(); + org.elasticsearch.Version version = org.elasticsearch.Version + .fromString(client.info(RequestOptions.DEFAULT).getVersion().getNumber()); return new Version(version.major, version.minor, version.revision); } catch (Exception e) { @@ -91,10 +93,10 @@ public final class TestUtils { try (RestHighLevelClient client = restHighLevelClient()) { - return 0L == client + return 0L == SearchHitsUtil.getTotalCount(client .search(new SearchRequest(indexName) .source(SearchSourceBuilder.searchSource().query(QueryBuilders.matchAllQuery())), RequestOptions.DEFAULT) - .getHits().getTotalHits(); + .getHits()); } } diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java index 406957220..d55d95ef3 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientTests.java @@ -30,7 +30,6 @@ import java.util.stream.IntStream; import org.elasticsearch.ElasticsearchStatusException; import org.elasticsearch.Version; -import org.elasticsearch.action.admin.indices.create.CreateIndexRequest; import org.elasticsearch.action.admin.indices.get.GetIndexRequest; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.get.GetRequest; @@ -41,6 +40,7 @@ import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; +import org.elasticsearch.client.indices.CreateIndexRequest; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.query.QueryBuilders; @@ -65,7 +65,7 @@ import org.springframework.test.context.junit4.SpringRunner; /** * @author Christoph Strobl * @author Mark Paluch - * @currentRead Fool's Fate - Robin Hobb + * @author Peter-Josef Meisch */ @RunWith(SpringRunner.class) @ContextConfiguration("classpath:infrastructure.xml") @@ -79,7 +79,9 @@ public class ReactiveElasticsearchClientTests { static final String TYPE_I = "doc-type-1"; static final String TYPE_II = "doc-type-2"; - static final Map DOC_SOURCE; + // must be and not , otherwise UpdateRequest.doc() will use the overload with + // (Object...) + static final Map DOC_SOURCE; RestHighLevelClient syncClient; ReactiveElasticsearchClient client; @@ -135,7 +137,6 @@ public class ReactiveElasticsearchClientTests { client.info().as(StepVerifier::create) // .consumeNextWith(it -> { - assertThat(it.isAvailable()).isTrue(); assertThat(it.getVersion()).isGreaterThanOrEqualTo(Version.CURRENT); }) // .verifyComplete(); diff --git a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java index dab800a52..e540f8079 100644 --- a/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/client/reactive/ReactiveElasticsearchClientUnitTests.java @@ -179,7 +179,7 @@ public class ReactiveElasticsearchClientUnitTests { verify(hostProvider.client(HOST)).method(HttpMethod.GET); URI uri = hostProvider.when(HOST).captureUri(); - assertThat(uri.getRawPath()).isEqualTo("/twitter/_all/1"); + assertThat(uri.getRawPath()).isEqualTo("/twitter/_doc/1"); } @Test // DATAES-488 @@ -315,7 +315,7 @@ public class ReactiveElasticsearchClientUnitTests { verify(hostProvider.client(HOST)).method(HttpMethod.HEAD); URI uri = hostProvider.when(HOST).captureUri(); - assertThat(uri.getRawPath()).isEqualTo("/twitter/_all/1"); + assertThat(uri.getRawPath()).isEqualTo("/twitter/_doc/1"); } @Test // DATAES-488 @@ -359,7 +359,7 @@ public class ReactiveElasticsearchClientUnitTests { }); URI uri = hostProvider.when(HOST).captureUri(); - assertThat(uri.getRawPath()).isEqualTo("/twitter/10/_create"); + assertThat(uri.getRawPath()).isEqualTo("/twitter/_doc/10/_create"); } @Test // DATAES-488 @@ -378,7 +378,7 @@ public class ReactiveElasticsearchClientUnitTests { }); URI uri = hostProvider.when(HOST).captureUri(); - assertThat(uri.getRawPath()).isEqualTo("/twitter/10"); + assertThat(uri.getRawPath()).isEqualTo("/twitter/_doc/10"); } @Test // DATAES-488 diff --git a/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java b/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java index e2ffcd2b8..78ad6aa2c 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/DefaultResultMapperTests.java @@ -33,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.lucene.search.TotalHits; import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.get.MultiGetItemResponse; import org.elasticsearch.action.get.MultiGetResponse; @@ -51,7 +52,6 @@ import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; import org.mockito.Mock; import org.mockito.MockitoAnnotations; - import org.springframework.core.convert.support.DefaultConversionService; import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Version; @@ -113,7 +113,7 @@ public class DefaultResultMapperTests { // given SearchHit[] hits = { createCarHit("Ford", "Grat"), createCarHit("BMW", "Arrow") }; SearchHits searchHits = mock(SearchHits.class); - when(searchHits.getTotalHits()).thenReturn(2L); + when(searchHits.getTotalHits()).thenReturn(new TotalHits(2L, TotalHits.Relation.EQUAL_TO)); when(searchHits.iterator()).thenReturn(new ArrayIterator(hits)); when(response.getHits()).thenReturn(searchHits); @@ -135,7 +135,7 @@ public class DefaultResultMapperTests { // given SearchHit[] hits = { createCarHit("Ford", "Grat"), createCarHit("BMW", "Arrow") }; SearchHits searchHits = mock(SearchHits.class); - when(searchHits.getTotalHits()).thenReturn(2L); + when(searchHits.getTotalHits()).thenReturn(new TotalHits(2L, TotalHits.Relation.EQUAL_TO)); when(searchHits.iterator()).thenReturn(new ArrayIterator(hits)); when(response.getHits()).thenReturn(searchHits); @@ -154,7 +154,7 @@ public class DefaultResultMapperTests { // given SearchHit[] hits = { createCarPartialHit("Ford", "Grat"), createCarPartialHit("BMW", "Arrow") }; SearchHits searchHits = mock(SearchHits.class); - when(searchHits.getTotalHits()).thenReturn(2L); + when(searchHits.getTotalHits()).thenReturn(new TotalHits(2L, TotalHits.Relation.EQUAL_TO)); when(searchHits.iterator()).thenReturn(new ArrayIterator(hits)); when(response.getHits()).thenReturn(searchHits); @@ -247,7 +247,7 @@ public class DefaultResultMapperTests { when(hit2.getVersion()).thenReturn(5678L); SearchHits searchHits = mock(SearchHits.class); - when(searchHits.getTotalHits()).thenReturn(2L); + when(searchHits.getTotalHits()).thenReturn(new TotalHits(2L, TotalHits.Relation.EQUAL_TO)); when(searchHits.iterator()).thenReturn(Arrays.asList(hit1, hit2).iterator()); SearchResponse searchResponse = mock(SearchResponse.class); diff --git a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java index 7d5b28150..1c8301213 100755 --- a/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchTemplateTests.java @@ -2624,7 +2624,7 @@ public class ElasticsearchTemplateTests { // then assertThat(created).isTrue(); Map setting = elasticsearchTemplate.getSetting(UseServerConfigurationEntity.class); - assertThat(setting.get("index.number_of_shards")).isEqualTo("5"); + assertThat(setting.get("index.number_of_shards")).isEqualTo("1"); assertThat(setting.get("index.number_of_replicas")).isEqualTo("1"); } diff --git a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java index 88cc2e066..eaf031793 100644 --- a/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java +++ b/src/test/java/org/springframework/data/elasticsearch/core/geo/ElasticsearchTemplateGeoTests.java @@ -27,7 +27,7 @@ import lombok.Setter; import java.util.ArrayList; import java.util.List; -import org.elasticsearch.common.geo.GeoHashUtils; +import org.elasticsearch.geo.utils.Geohash; import org.elasticsearch.index.query.QueryBuilders; import org.junit.Before; import org.junit.Test; @@ -86,7 +86,7 @@ public class ElasticsearchTemplateGeoTests { double[] lonLatArray = { 0.100000, 51.000000 }; String latLonString = "51.000000, 0.100000"; String geohash = "u10j46mkfekr"; - GeoHashUtils.stringEncode(0.100000, 51.000000); + Geohash.stringEncode(0.100000, 51.000000); LocationMarkerEntity location1 = LocationMarkerEntity.builder() // .id("1").name("Artur Konczak") // .locationAsString(latLonString) // @@ -258,7 +258,7 @@ public class ElasticsearchTemplateGeoTests { // given loadClassBaseEntities(); CriteriaQuery geoLocationCriteriaQuery3 = new CriteriaQuery(new Criteria("location") - .boundedBy(GeoHashUtils.stringEncode(0, 53.5171d), GeoHashUtils.stringEncode(0.2062d, 49.5171d))); + .boundedBy(Geohash.stringEncode(0, 53.5171d), Geohash.stringEncode(0.2062d, 49.5171d))); // when List geoAuthorsForGeoCriteria3 = elasticsearchTemplate.queryForList(geoLocationCriteriaQuery3, diff --git a/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-6.8.1.jar b/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-6.8.1.jar deleted file mode 100644 index 3144fa5a7..000000000 Binary files a/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-6.8.1.jar and /dev/null differ diff --git a/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-7.3.0.jar b/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-7.3.0.jar new file mode 100644 index 000000000..32326a98f Binary files /dev/null and b/src/test/resources/test-home-dir/modules/analysis-common/analysis-common-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/analysis-common/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/analysis-common/plugin-descriptor.properties index 614e3217b..06ead6f5f 100644 --- a/src/test/resources/test-home-dir/modules/analysis-common/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/analysis-common/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=Adds "built in" analyzers to Elasticsearch. # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=analysis-common @@ -35,7 +35,7 @@ classname=org.elasticsearch.analysis.common.CommonAnalysisPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-6.8.1.jar b/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-7.3.0.jar similarity index 86% rename from src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-6.8.1.jar rename to src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-7.3.0.jar index 31b1ef980..2f2849071 100644 Binary files a/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-6.8.1.jar and b/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-dissect-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-6.8.1.jar b/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-7.3.0.jar similarity index 51% rename from src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-6.8.1.jar rename to src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-7.3.0.jar index 4c21c6ccc..b665a2d60 100644 Binary files a/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-6.8.1.jar and b/src/test/resources/test-home-dir/modules/ingest-common/elasticsearch-grok-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/ingest-common/ingest-common-6.8.1.jar b/src/test/resources/test-home-dir/modules/ingest-common/ingest-common-7.3.0.jar similarity index 52% rename from src/test/resources/test-home-dir/modules/ingest-common/ingest-common-6.8.1.jar rename to src/test/resources/test-home-dir/modules/ingest-common/ingest-common-7.3.0.jar index 720d319ed..b3c7cf91f 100644 Binary files a/src/test/resources/test-home-dir/modules/ingest-common/ingest-common-6.8.1.jar and b/src/test/resources/test-home-dir/modules/ingest-common/ingest-common-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.12.jar b/src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.44.jar similarity index 67% rename from src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.12.jar rename to src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.44.jar index 5493b50b4..ba13f142e 100644 Binary files a/src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.12.jar and b/src/test/resources/test-home-dir/modules/ingest-common/jcodings-1.0.44.jar differ diff --git a/src/test/resources/test-home-dir/modules/ingest-common/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/ingest-common/plugin-descriptor.properties index 75a092172..c003bd5a4 100644 --- a/src/test/resources/test-home-dir/modules/ingest-common/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/ingest-common/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=Module for ingest processors that do not require additional security permissions or have large dependencies and resources # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=ingest-common @@ -35,7 +35,7 @@ classname=org.elasticsearch.ingest.common.IngestCommonPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/lang-expression/lang-expression-6.8.1.jar b/src/test/resources/test-home-dir/modules/lang-expression/lang-expression-7.3.0.jar similarity index 51% rename from src/test/resources/test-home-dir/modules/lang-expression/lang-expression-6.8.1.jar rename to src/test/resources/test-home-dir/modules/lang-expression/lang-expression-7.3.0.jar index c159c159d..d6086153d 100644 Binary files a/src/test/resources/test-home-dir/modules/lang-expression/lang-expression-6.8.1.jar and b/src/test/resources/test-home-dir/modules/lang-expression/lang-expression-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-7.7.0.jar b/src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-8.1.0.jar similarity index 86% rename from src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-7.7.0.jar rename to src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-8.1.0.jar index efafbd09f..104ce5388 100644 Binary files a/src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-7.7.0.jar and b/src/test/resources/test-home-dir/modules/lang-expression/lucene-expressions-8.1.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/lang-expression/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/lang-expression/plugin-descriptor.properties index 1e0675d63..c72d520fa 100644 --- a/src/test/resources/test-home-dir/modules/lang-expression/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/lang-expression/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=Lucene expressions integration for Elasticsearch # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=lang-expression @@ -35,7 +35,7 @@ classname=org.elasticsearch.script.expression.ExpressionPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-6.8.1.jar b/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-6.8.1.jar deleted file mode 100644 index 6b0ff6842..000000000 Binary files a/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-6.8.1.jar and /dev/null differ diff --git a/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-7.3.0.jar b/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-7.3.0.jar new file mode 100644 index 000000000..c3466f628 Binary files /dev/null and b/src/test/resources/test-home-dir/modules/lang-painless/elasticsearch-scripting-painless-spi-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/lang-painless/lang-painless-6.8.1.jar b/src/test/resources/test-home-dir/modules/lang-painless/lang-painless-7.3.0.jar similarity index 62% rename from src/test/resources/test-home-dir/modules/lang-painless/lang-painless-6.8.1.jar rename to src/test/resources/test-home-dir/modules/lang-painless/lang-painless-7.3.0.jar index 9dcd6585f..e49983047 100644 Binary files a/src/test/resources/test-home-dir/modules/lang-painless/lang-painless-6.8.1.jar and b/src/test/resources/test-home-dir/modules/lang-painless/lang-painless-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/lang-painless/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/lang-painless/plugin-descriptor.properties index cb3d13f94..76d620198 100644 --- a/src/test/resources/test-home-dir/modules/lang-painless/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/lang-painless/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=An easy, safe and fast scripting language for Elasticsearch # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=lang-painless @@ -35,7 +35,7 @@ classname=org.elasticsearch.painless.PainlessPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-6.8.1.jar b/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-6.8.1.jar deleted file mode 100644 index 8680f3b70..000000000 Binary files a/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-6.8.1.jar and /dev/null differ diff --git a/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-7.3.0.jar b/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-7.3.0.jar new file mode 100644 index 000000000..8ffd2036a Binary files /dev/null and b/src/test/resources/test-home-dir/modules/mapper-extras/mapper-extras-7.3.0.jar differ diff --git a/src/test/resources/test-home-dir/modules/mapper-extras/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/mapper-extras/plugin-descriptor.properties index 57ac2e670..2faf762e5 100644 --- a/src/test/resources/test-home-dir/modules/mapper-extras/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/mapper-extras/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=Adds advanced field mappers # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=mapper-extras @@ -35,11 +35,11 @@ classname=org.elasticsearch.index.mapper.MapperExtrasPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI -extended.plugins= +extended.plugins=lang-painless # # 'has.native.controller': whether or not the plugin has a native controller has.native.controller=false diff --git a/src/test/resources/test-home-dir/modules/reindex/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/reindex/plugin-descriptor.properties index 0e9e9979e..526e6b74a 100644 --- a/src/test/resources/test-home-dir/modules/reindex/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/reindex/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=The Reindex module adds APIs to reindex from one index to another or update documents in place. # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=reindex @@ -35,7 +35,7 @@ classname=org.elasticsearch.index.reindex.ReindexPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/repository-url/plugin-descriptor.properties b/src/test/resources/test-home-dir/modules/repository-url/plugin-descriptor.properties index 340b26bfb..39cef7de4 100644 --- a/src/test/resources/test-home-dir/modules/repository-url/plugin-descriptor.properties +++ b/src/test/resources/test-home-dir/modules/repository-url/plugin-descriptor.properties @@ -20,7 +20,7 @@ description=Module for URL repository # # 'version': plugin's version -version=6.8.1 +version=7.3.0 # # 'name': the plugin name name=repository-url @@ -35,7 +35,7 @@ classname=org.elasticsearch.plugin.repository.url.URLRepositoryPlugin java.version=1.8 # # 'elasticsearch.version': version of elasticsearch compiled against -elasticsearch.version=6.8.1 +elasticsearch.version=7.3.0 ### optional elements for plugins: # # 'extended.plugins': other plugins this plugin extends through SPI diff --git a/src/test/resources/test-home-dir/modules/repository-url/repository-url-6.8.1.jar b/src/test/resources/test-home-dir/modules/repository-url/repository-url-6.8.1.jar deleted file mode 100644 index af2e541be..000000000 Binary files a/src/test/resources/test-home-dir/modules/repository-url/repository-url-6.8.1.jar and /dev/null differ diff --git a/src/test/resources/test-home-dir/modules/repository-url/repository-url-7.3.0.jar b/src/test/resources/test-home-dir/modules/repository-url/repository-url-7.3.0.jar new file mode 100644 index 000000000..38ddadf30 Binary files /dev/null and b/src/test/resources/test-home-dir/modules/repository-url/repository-url-7.3.0.jar differ