1
0
mirror of synced 2026-05-23 12:43:17 +00:00

Compare commits

...

12 Commits

Author SHA1 Message Date
Christoph Strobl 4e572679dd DATAES-662 - Release version 3.2.1 (Moore SR1). 2019-11-04 14:55:02 +01:00
Christoph Strobl de9c664d1e DATAES-662 - Prepare 3.2.1 (Moore SR1). 2019-11-04 14:54:16 +01:00
Christoph Strobl 8187c5362a DATAES-662 - Updated changelog. 2019-11-04 14:54:15 +01:00
Christoph Strobl a8eb260bbd DATAES-660 - Updated changelog. 2019-11-04 10:34:54 +01:00
Peter-Josef Meisch bb944f595f DATAES-679 - Upgrade_to_Elasticsearch_6.8.4.
Original PR: #339
2019-10-31 17:40:24 +01:00
Henrique Amaral 598626238b DATAES-673 Create a Ssl Rest Client using SslContext and HostnameVerifier 2019-10-23 19:22:34 +02:00
Gyula Csörögi a451f8dca4 DATAES-671 - Missing indicesOptions support for scrolling queries.
Original PR: #332
2019-10-16 09:00:44 +02:00
Peter-Josef Meisch 4fd070c332 DATAES-670 - Fix version compatibility matrix in documentation.
Original PR: #330
2019-10-12 10:42:27 +02:00
Mark Paluch 091413dd69 DATAES-665 - Fix plugin ordering to deploy Javadoc. 2019-10-01 08:39:10 +02:00
Greg Turnquist ff74425132 DATAES-625 - Create CI job. 2019-09-30 14:23:41 -05:00
Mark Paluch 6f4d1dcc57 DATAES-625 - After release cleanups. 2019-09-30 16:17:54 +02:00
Mark Paluch 9713e33fed DATAES-625 - Prepare next development iteration. 2019-09-30 16:17:53 +02:00
30 changed files with 171 additions and 35 deletions
Vendored
+4 -4
View File
@@ -3,7 +3,7 @@ pipeline {
triggers {
pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
upstream(upstreamProjects: "spring-data-commons/2.2.x", threshold: hudson.model.Result.SUCCESS)
}
options {
@@ -15,7 +15,7 @@ pipeline {
stage("Test") {
when {
anyOf {
branch 'master'
branch '3.2.x'
not { triggeredBy 'UpstreamCause' }
}
}
@@ -39,7 +39,7 @@ pipeline {
stage('Release to artifactory') {
when {
anyOf {
branch 'master'
branch '3.2.x'
not { triggeredBy 'UpstreamCause' }
}
}
@@ -70,7 +70,7 @@ pipeline {
}
stage('Publish documentation') {
when {
branch 'master'
branch '3.2.x'
}
agent {
docker {
+12 -12
View File
@@ -5,12 +5,12 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.2.0.RELEASE</version>
<version>3.2.1.RELEASE</version>
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.2.0.RELEASE</version>
<version>2.2.1.RELEASE</version>
</parent>
<name>Spring Data Elasticsearch</name>
@@ -19,9 +19,9 @@
<properties>
<commonslang>2.6</commonslang>
<elasticsearch>6.8.1</elasticsearch>
<elasticsearch>6.8.4</elasticsearch>
<log4j>2.9.1</log4j>
<springdata.commons>2.2.0.RELEASE</springdata.commons>
<springdata.commons>2.2.1.RELEASE</springdata.commons>
<netty>4.1.39.Final</netty>
<java-module-name>spring.data.elasticsearch</java-module-name>
</properties>
@@ -267,14 +267,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
</plugin>
<!--
please do not remove this configuration for surefire - we need that to avoid issue with jar hell
-->
@@ -292,6 +284,14 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
+2 -2
View File
@@ -35,8 +35,8 @@ The following table shows the Elasticsearch versions that are used by Spring Dat
[cols="^,^,^,^",options="header"]
|===
|Spring Data Release Train |Spring Data Elasticsearch |Elasticsearch | Spring Boot
|Moorefootnote:cdv[Currently in development] |3.2.xfootnote:cdv[]|6.8.1 / 7.xfootnote:hrc[via the <<elasticsearch.clients.rest,high-level REST client>>]|2.2.0footnote:cdv[]
|Lovelace |3.1.x |6.2.2 / 7.xfootnote:hrc[]|2.1.x
|Moore |3.2.x |6.8.4 |2.2.x
|Lovelace |3.1.x |6.2.2|2.1.x
|Kayfootnote:oom[Out of maintenance]|3.0.xfootnote:oom[] |5.5.0 |2.0.xfootnote:oom[]
|Ingallsfootnote:oom[]|2.1.xfootnote:oom[] |2.4.0 |1.5.xfootnote:oom[]
|===
@@ -21,6 +21,7 @@ import java.time.Duration;
import java.util.List;
import java.util.Optional;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import org.springframework.http.HttpHeaders;
@@ -30,6 +31,7 @@ import org.springframework.http.HttpHeaders;
*
* @author Mark Paluch
* @author Peter-Josef Meisch
* @author Henrique Amaral
* @since 3.2
*/
public interface ClientConfiguration {
@@ -118,6 +120,13 @@ public interface ClientConfiguration {
*/
Optional<SSLContext> getSslContext();
/**
* Returns the {@link HostnameVerifier} to use. Can be {@link Optional#empty()} if unconfigured.
*
* @return the {@link HostnameVerifier} to use. Can be {@link Optional#empty()} if unconfigured.
*/
Optional<HostnameVerifier> getHostNameVerifier();
/**
* Returns the {@link java.time.Duration connect timeout}.
*
@@ -201,6 +210,16 @@ public interface ClientConfiguration {
* @return the {@link TerminalClientConfigurationBuilder}.
*/
TerminalClientConfigurationBuilder usingSsl(SSLContext sslContext);
/**
* Connect via {@literal https} using the givens {@link SSLContext} and HostnameVerifier {@link HostnameVerifier} .<br />
*
* <strong>NOTE</strong> You need to leave out the protocol in
* {@link ClientConfigurationBuilderWithRequiredEndpoint#connectedTo(String)}.
*
* @return the {@link TerminalClientConfigurationBuilder}.
*/
TerminalClientConfigurationBuilder usingSsl(SSLContext sslContext, HostnameVerifier hostnameVerifier);
}
/**
@@ -22,6 +22,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import org.springframework.data.elasticsearch.client.ClientConfiguration.ClientConfigurationBuilderWithRequiredEndpoint;
@@ -37,6 +38,7 @@ import org.springframework.util.Assert;
* @author Christoph Strobl
* @author Mark Paluch
* @author Peter-Josef Meisch
* @author Henrique Amaral
* @since 3.2
*/
class ClientConfigurationBuilder
@@ -46,6 +48,7 @@ class ClientConfigurationBuilder
private HttpHeaders headers = HttpHeaders.EMPTY;
private boolean useSsl;
private @Nullable SSLContext sslContext;
private @Nullable HostnameVerifier hostnameVerifier;
private Duration connectTimeout = Duration.ofSeconds(10);
private Duration soTimeout = Duration.ofSeconds(5);
private String username;
@@ -103,6 +106,22 @@ class ClientConfigurationBuilder
return this;
}
/*
* (non-Javadoc)
* @see org.springframework.data.elasticsearch.client.ClientConfiguration.MaybeSecureClientConfigurationBuilder#usingSsl(javax.net.ssl.SSLContext, javax.net.ssl.HostnameVerifier)
*/
@Override
public TerminalClientConfigurationBuilder usingSsl(SSLContext sslContext, HostnameVerifier hostnameVerifier) {
Assert.notNull(sslContext, "SSL Context must not be null");
Assert.notNull(hostnameVerifier, "Host Name Verifier must not be null");
this.useSsl = true;
this.sslContext = sslContext;
this.hostnameVerifier = hostnameVerifier;
return this;
}
/*
* (non-Javadoc)
* @see org.springframework.data.elasticsearch.client.ClientConfiguration.TerminalClientConfigurationBuilder#withDefaultHeaders(org.springframework.http.HttpHeaders)
@@ -171,7 +190,7 @@ class ClientConfigurationBuilder
}
return new DefaultClientConfiguration(this.hosts, this.headers, this.useSsl, this.sslContext, this.soTimeout,
this.connectTimeout);
this.connectTimeout, this.hostnameVerifier);
}
private static InetSocketAddress parse(String hostAndPort) {
@@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import org.springframework.http.HttpHeaders;
@@ -42,9 +43,10 @@ class DefaultClientConfiguration implements ClientConfiguration {
private final @Nullable SSLContext sslContext;
private final Duration soTimeout;
private final Duration connectTimeout;
private final @Nullable HostnameVerifier hostnameVerifier;
DefaultClientConfiguration(List<InetSocketAddress> hosts, HttpHeaders headers, boolean useSsl,
@Nullable SSLContext sslContext, Duration soTimeout, Duration connectTimeout) {
@Nullable SSLContext sslContext, Duration soTimeout, Duration connectTimeout, @Nullable HostnameVerifier hostnameVerifier) {
this.hosts = Collections.unmodifiableList(new ArrayList<>(hosts));
this.headers = new HttpHeaders(headers);
@@ -52,6 +54,7 @@ class DefaultClientConfiguration implements ClientConfiguration {
this.sslContext = sslContext;
this.soTimeout = soTimeout;
this.connectTimeout = connectTimeout;
this.hostnameVerifier = hostnameVerifier;
}
/*
@@ -90,6 +93,15 @@ class DefaultClientConfiguration implements ClientConfiguration {
return Optional.ofNullable(this.sslContext);
}
/*
* (non-Javadoc)
* @see org.springframework.data.elasticsearch.client.ClientConfiguration#getHostNameVerifier()
*/
@Override
public Optional<HostnameVerifier> getHostNameVerifier() {
return Optional.ofNullable(this.hostnameVerifier);
}
/*
* (non-Javadoc)
* @see org.springframework.data.elasticsearch.client.ClientConfiguration#getConnectTimeout()
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import org.apache.http.Header;
@@ -52,6 +53,7 @@ import org.springframework.util.Assert;
*
* @author Christoph Strobl
* @author Mark Paluch
* @author Henrique Amaral
* @since 3.2
*/
public final class RestClients {
@@ -87,7 +89,9 @@ public final class RestClients {
builder.setHttpClientConfigCallback(clientBuilder -> {
Optional<SSLContext> sslContext = clientConfiguration.getSslContext();
Optional<HostnameVerifier> hostNameVerifier = clientConfiguration.getHostNameVerifier();
sslContext.ifPresent(clientBuilder::setSSLContext);
hostNameVerifier.ifPresent(clientBuilder::setSSLHostnameVerifier);
if (ClientLogger.isEnabled()) {
@@ -960,6 +960,10 @@ public class ElasticsearchRestTemplate extends AbstractElasticsearchTemplate
prepareSort(query, searchSourceBuilder, entity);
}
if (query.getIndicesOptions() != null) {
request.indicesOptions(query.getIndicesOptions());
}
if (query instanceof SearchQuery) {
SearchQuery searchQuery = (SearchQuery) query;
@@ -810,6 +810,10 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate
prepareSort(query, requestBuilder, entity);
}
if (query.getIndicesOptions() != null) {
requestBuilder.setIndicesOptions(query.getIndicesOptions());
}
if (query instanceof SearchQuery) {
SearchQuery searchQuery = (SearchQuery) query;
+15
View File
@@ -1,6 +1,21 @@
Spring Data Elasticsearch Changelog
===================================
Changes in version 3.2.1.RELEASE (2019-11-04)
---------------------------------------------
* DATAES-679 - Upgrade to Elasticsearch 6.8.4.
* DATAES-673 - Create a Ssl Rest Client using SslContext and HostnameVerifier.
* DATAES-671 - Missing indicesOptions support for scrolling queries.
* DATAES-670 - fix version compatibility matrix in documentation.
* DATAES-665 - Javadoc not deployed.
* DATAES-662 - Release 3.2.1 (Moore SR1).
Changes in version 3.1.12.RELEASE (2019-11-04)
----------------------------------------------
* DATAES-660 - Release 3.1.12 (Lovelace SR12).
Changes in version 3.2.0.RELEASE (2019-09-30)
---------------------------------------------
* DATAES-657 - Sort by _score not supported by ElasticsearchRestTemplate.
+1 -1
View File
@@ -1,4 +1,4 @@
Spring Data Elasticsearch 3.2 GA
Spring Data Elasticsearch 3.2.1
Copyright (c) [2013-2019] Pivotal Software, Inc.
This product is licensed to you under the Apache License, Version 2.0 (the "License").
@@ -23,6 +23,7 @@ import java.time.Duration;
import javax.net.ssl.SSLContext;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.junit.Test;
import org.springframework.http.HttpHeaders;
@@ -31,6 +32,7 @@ import org.springframework.http.HttpHeaders;
*
* @author Mark Paluch
* @author Peter-Josef Meisch
* @author Henrique Amaral
*/
public class ClientConfigurationUnitTests {
@@ -117,6 +119,25 @@ public class ClientConfigurationUnitTests {
assertThat(defaultHeaders.get(HttpHeaders.AUTHORIZATION)).isNull();
}
@Test // DATAES-673
public void shouldCreateSslConfigurationWithHostnameVerifier() {
SSLContext sslContext = mock(SSLContext.class);
ClientConfiguration clientConfiguration = ClientConfiguration.builder() //
.connectedTo("foo", "bar") //
.usingSsl(sslContext, NoopHostnameVerifier.INSTANCE) //
.build();
assertThat(clientConfiguration.getEndpoints()).containsOnly(InetSocketAddress.createUnresolved("foo", 9200),
InetSocketAddress.createUnresolved("bar", 9200));
assertThat(clientConfiguration.useSsl()).isTrue();
assertThat(clientConfiguration.getSslContext()).contains(sslContext);
assertThat(clientConfiguration.getConnectTimeout()).isEqualTo(Duration.ofSeconds(10));
assertThat(clientConfiguration.getSocketTimeout()).isEqualTo(Duration.ofSeconds(5));
assertThat(clientConfiguration.getHostNameVerifier()).contains(NoopHostnameVerifier.INSTANCE);
}
private static String buildBasicAuth(String username, String password) {
HttpHeaders headers = new HttpHeaders();
@@ -1709,6 +1709,44 @@ public class ElasticsearchTemplateTests {
elasticsearchTemplate.clearScroll(scroll.getScrollId());
}
@Test // DATAES-671
public void shouldPassIndicesOptionsForGivenSearchScrollQuery() {
// given
long scrollTimeInMillis = 3000;
String documentId = randomNumeric(5);
SampleEntity sampleEntity = SampleEntity.builder().id(documentId).message("some message")
.version(System.currentTimeMillis()).build();
IndexQuery idxQuery = new IndexQueryBuilder().withIndexName(INDEX_1_NAME).withId(sampleEntity.getId())
.withObject(sampleEntity).build();
elasticsearchTemplate.index(idxQuery);
elasticsearchTemplate.refresh(INDEX_1_NAME);
// when
SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())
.withIndices(INDEX_1_NAME, INDEX_2_NAME).withIndicesOptions(IndicesOptions.lenientExpandOpen()).build();
List<SampleEntity> entities = new ArrayList<>();
ScrolledPage<SampleEntity> scroll = elasticsearchTemplate.startScroll(scrollTimeInMillis, searchQuery,
SampleEntity.class, searchResultMapper);
entities.addAll(scroll.getContent());
while (scroll.hasContent()) {
scroll = elasticsearchTemplate.continueScroll(scroll.getScrollId(), scrollTimeInMillis, SampleEntity.class,
searchResultMapper);
entities.addAll(scroll.getContent());
}
// then
assertThat(entities).isNotNull();
assertThat(entities.size()).isGreaterThanOrEqualTo(1);
}
@Test // DATAES-479
public void shouldHonorTheHighlightBuilderOptions() {
@@ -20,7 +20,7 @@
description=Adds "built in" analyzers to Elasticsearch.
#
# 'version': plugin's version
version=6.8.1
version=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -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=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -20,7 +20,7 @@
description=Lucene expressions integration for Elasticsearch
#
# 'version': plugin's version
version=6.8.1
version=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -20,7 +20,7 @@
description=An easy, safe and fast scripting language for Elasticsearch
#
# 'version': plugin's version
version=6.8.1
version=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -20,7 +20,7 @@
description=Adds advanced field mappers
#
# 'version': plugin's version
version=6.8.1
version=6.8.4
#
# 'name': the plugin name
name=mapper-extras
@@ -35,7 +35,7 @@ classname=org.elasticsearch.index.mapper.MapperExtrasPlugin
java.version=1.8
#
# 'elasticsearch.version': version of elasticsearch compiled against
elasticsearch.version=6.8.1
elasticsearch.version=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -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=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI
@@ -20,7 +20,7 @@
description=Module for URL repository
#
# 'version': plugin's version
version=6.8.1
version=6.8.4
#
# '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=6.8.4
### optional elements for plugins:
#
# 'extended.plugins': other plugins this plugin extends through SPI