Skip to content

Commit 7250c0a

Browse files
authored
Merge pull request #2 from spring-projects/main
Pull from origin
2 parents 5717d6e + 19d9830 commit 7250c0a

File tree

215 files changed

+1657
-4442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+1657
-4442
lines changed

Diff for: README.adoc

+15-36
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@ image:https://spring.io/badges/spring-data-elasticsearch/ga.svg[Spring Data Elas
44

55
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
66

7-
The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine. Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with a Elasticsearch Documents and easily writing a Repository style data access layer.
7+
The Spring Data Elasticsearch project provides integration with the https://www.elastic.co/[Elasticsearch] search engine.
8+
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with a Elasticsearch Documents and easily writing a Repository style data access layer.
89

910
This project is lead and maintained by the community.
1011

1112
== Features
1213

1314
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for a ES clients instances.
14-
* `ElasticsearchRestTemplate` helper class that increases productivity performing common ES operations. Includes integrated object mapping between documents and POJOs.
15+
* `ElasticsearchRestTemplate` helper class that increases productivity performing common ES operations.
16+
Includes integrated object mapping between documents and POJOs.
1517
* Feature Rich Object Mapping integrated with Spring’s Conversion Service
1618
* Annotation based mapping metadata
1719
* Automatic implementation of `Repository` interfaces including support for custom search methods.
1820
* CDI support for repositories
1921

2022
== Code of Conduct
2123

22-
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct]. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to [email protected].
24+
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].
25+
By participating, you are expected to uphold this code of conduct.
26+
Please report unacceptable behavior to [email protected].
2327

2428
== Getting Started
2529

@@ -58,31 +62,6 @@ public class MyService {
5862
}
5963
----
6064

61-
=== Using Transport Client
62-
63-
NOTE: Usage of the TransportClient is deprecated as of version 4.0, use RestClient instead.
64-
65-
66-
[source,java]
67-
----
68-
@Configuration
69-
public class TransportClientConfig extends ElasticsearchConfigurationSupport {
70-
71-
@Bean
72-
public Client elasticsearchClient() throws UnknownHostException {
73-
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
74-
TransportClient client = new PreBuiltTransportClient(settings);
75-
client.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
76-
return client;
77-
}
78-
79-
@Bean(name = { "elasticsearchOperations", "elasticsearchTemplate" })
80-
public ElasticsearchTemplate elasticsearchTemplate() throws UnknownHostException {
81-
return new ElasticsearchTemplate(elasticsearchClient());
82-
}
83-
}
84-
----
85-
8665
=== Using the RestClient
8766

8867
Provide a configuration like this:
@@ -161,7 +140,8 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
161140

162141
== Getting Help
163142

164-
Having trouble with Spring Data? We’d love to help!
143+
Having trouble with Spring Data?
144+
We’d love to help!
165145

166146
* Check the
167147
https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/[reference documentation], and https://docs.spring.io/spring-data/elasticsearch/docs/current/api/[Javadocs].
@@ -174,14 +154,16 @@ You can also chat with the community on https://gitter.im/spring-projects/spring
174154

175155
== Reporting Issues
176156

177-
Spring Data uses GitHub as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
157+
Spring Data uses GitHub as issue tracking system to record bugs and feature requests.
158+
If you want to raise an issue, please follow the recommendations below:
178159

179160
* Before you log a bug, please search the
180161
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
181162
* If the issue doesn’t already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
182163
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data Elasticsearch that you are using and JVM version.
183164
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
184-
* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.
165+
* If possible try to create a test-case or project that replicates the issue.
166+
Attach a link to your code or a compressed file containing your code.
185167

186168
== Building from Source
187169

@@ -197,11 +179,8 @@ If you want to build with the regular `mvn` command, you will need https://maven
197179

198180
_Also see link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] if you wish to submit pull requests, and in particular please sign the https://cla.pivotal.io/sign/spring[Contributor’s Agreement] before submitting your first pull request._
199181

200-
IMPORTANT: When contributing, please make sure an issue exists in https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] and comment on this issue with how you want to address it. By this we not only know that someone is working on an issue, we can also align architectural questions and possible solutions before work is invested
201-
. We
202-
so
203-
can prevent that much work is put into Pull Requests that have little
204-
or no chances of being merged.
182+
IMPORTANT: When contributing, please make sure an issue exists in https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] and comment on this issue with how you want to address it.
183+
By this we not only know that someone is working on an issue, we can also align architectural questions and possible solutions before work is invested . We so can prevent that much work is put into Pull Requests that have little or no chances of being merged.
205184

206185

207186
=== Building reference documentation

Diff for: pom.xml

+4-45
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55

66
<groupId>org.springframework.data</groupId>
77
<artifactId>spring-data-elasticsearch</artifactId>
8-
<version>4.3.0-SNAPSHOT</version>
8+
<version>4.4.0-SNAPSHOT</version>
99

1010
<parent>
1111
<groupId>org.springframework.data.build</groupId>
1212
<artifactId>spring-data-parent</artifactId>
13-
<version>2.6.0-SNAPSHOT</version>
13+
<version>2.7.0-SNAPSHOT</version>
1414
</parent>
1515

1616
<name>Spring Data Elasticsearch</name>
1717
<description>Spring Data Implementation for Elasticsearch</description>
1818
<url>https://github.com/spring-projects/spring-data-elasticsearch</url>
1919

2020
<properties>
21-
<elasticsearch>7.15.1</elasticsearch>
21+
<elasticsearch>7.15.2</elasticsearch>
2222
<log4j>2.14.1</log4j>
2323
<netty>4.1.65.Final</netty>
24-
<springdata.commons>2.6.0-SNAPSHOT</springdata.commons>
24+
<springdata.commons>2.7.0-SNAPSHOT</springdata.commons>
2525
<testcontainers>1.15.3</testcontainers>
2626
<blockhound-junit>1.0.6.RELEASE</blockhound-junit>
2727
<java-module-name>spring.data.elasticsearch</java-module-name>
@@ -101,12 +101,6 @@
101101
<dependency>
102102
<groupId>org.springframework</groupId>
103103
<artifactId>spring-context</artifactId>
104-
<exclusions>
105-
<exclusion>
106-
<groupId>commons-logging</groupId>
107-
<artifactId>commons-logging</artifactId>
108-
</exclusion>
109-
</exclusions>
110104
</dependency>
111105

112106
<dependency>
@@ -141,19 +135,6 @@
141135
</dependency>
142136

143137
<!-- Elasticsearch -->
144-
<dependency>
145-
<groupId>org.elasticsearch.client</groupId>
146-
<artifactId>transport</artifactId>
147-
<version>${elasticsearch}</version>
148-
</dependency>
149-
150-
<dependency>
151-
<!-- required by elasticsearch -->
152-
<groupId>org.elasticsearch.plugin</groupId>
153-
<artifactId>transport-netty4-client</artifactId>
154-
<version>${elasticsearch}</version>
155-
</dependency>
156-
157138
<dependency>
158139
<groupId>org.elasticsearch.client</groupId>
159140
<artifactId>elasticsearch-rest-high-level-client</artifactId>
@@ -166,21 +147,6 @@
166147
</exclusions>
167148
</dependency>
168149

169-
<!-- Logging -->
170-
<dependency>
171-
<groupId>org.slf4j</groupId>
172-
<artifactId>log4j-over-slf4j</artifactId>
173-
<version>${slf4j}</version>
174-
<scope>test</scope>
175-
</dependency>
176-
177-
<dependency>
178-
<groupId>org.apache.logging.log4j</groupId>
179-
<artifactId>log4j-core</artifactId>
180-
<version>${log4j}</version>
181-
<scope>test</scope>
182-
</dependency>
183-
184150
<!-- Jackson JSON Mapper -->
185151
<dependency>
186152
<groupId>com.fasterxml.jackson.core</groupId>
@@ -242,13 +208,6 @@
242208
</exclusions>
243209
</dependency>
244210

245-
<dependency>
246-
<groupId>org.apache.logging.log4j</groupId>
247-
<artifactId>log4j-to-slf4j</artifactId>
248-
<version>${log4j}</version>
249-
<scope>test</scope>
250-
</dependency>
251-
252211
<dependency>
253212
<groupId>io.projectreactor.tools</groupId>
254213
<artifactId>blockhound-junit-platform</artifactId>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ 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.1 | 5.3.xfootnote:cdv[] | 2.5 .xfootnote:cdv[]
37+
| 2021.1 (Q)footnote:cdv[Currently in development] | 4.3.xfootnote:cdv[] | 7.15.2 | 5.3.xfootnote:cdv[] | 2.5 .xfootnote:cdv[]
3838
| 2021.0 (Pascal) | 4.2.x | 7.12.0 | 5.3.x | 2.5.x
3939
| 2020.0 (Ockham) | 4.1.x | 7.9.3 | 5.3.2 | 2.4.x
4040
| Neumann | 4.0.x | 7.6.2 | 5.2.12 |2.3.x

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

+2-50
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,10 @@ This chapter illustrates configuration and usage of supported Elasticsearch clie
66
Spring Data Elasticsearch operates upon an Elasticsearch client that is connected to a single Elasticsearch node or a cluster.
77
Although the Elasticsearch Client can be used to work with the cluster, applications using Spring Data Elasticsearch normally use the higher level abstractions of <<elasticsearch.operations>> and <<elasticsearch.repositories>>.
88

9-
[[elasticsearch.clients.transport]]
10-
== Transport Client
11-
12-
WARNING: The `TransportClient` is deprecated as of Elasticsearch 7 and will be removed in Elasticsearch 8. (https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html[see the Elasticsearch documentation]).
13-
Spring Data Elasticsearch will support the `TransportClient` as long as it is available in the used Elasticsearch <<elasticsearch.versions,version>> but has deprecated the classes using it since version 4.0.
14-
15-
We strongly recommend to use the <<elasticsearch.clients.rest>> instead of the `TransportClient`.
16-
17-
.Transport Client
18-
====
19-
[source,java]
20-
----
21-
@Configuration
22-
public class TransportClientConfig extends ElasticsearchConfigurationSupport {
23-
24-
@Bean
25-
public Client elasticsearchClient() throws UnknownHostException {
26-
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build(); <.>
27-
TransportClient client = new PreBuiltTransportClient(settings);
28-
client.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300)); <.>
29-
return client;
30-
}
31-
32-
@Bean(name = { "elasticsearchOperations", "elasticsearchTemplate" })
33-
public ElasticsearchTemplate elasticsearchTemplate() throws UnknownHostException {
34-
35-
ElasticsearchTemplate template = new ElasticsearchTemplate(elasticsearchClient, elasticsearchConverter);
36-
template.setRefreshPolicy(refreshPolicy()); <.>
37-
38-
return template;
39-
}
40-
}
41-
42-
// ...
43-
44-
IndexRequest request = new IndexRequest("spring-data")
45-
.id(randomID())
46-
.source(someObject);
47-
48-
IndexResponse response = client.index(request);
49-
----
50-
51-
<.> The `TransportClient` must be configured with the cluster name.
52-
<.> The host and port to connect the client to.
53-
<.> the RefreshPolicy must be set in the `ElasticsearchTemplate` (override `refreshPolicy()` to not use the default)
54-
====
55-
569
[[elasticsearch.clients.rest]]
5710
== High Level REST Client
5811

59-
The Java High Level REST Client is the default client of Elasticsearch, it provides a straight forward replacement for the `TransportClient` as it accepts and returns the very same request/response objects and therefore depends on the Elasticsearch core project.
60-
Asynchronous calls are operated upon a client managed thread pool and require a callback to be notified when the request is done.
12+
The Java High Level REST Client is the default client of Elasticsearch, it is configured like shown:
6113

6214
.High Level REST Client
6315
====
@@ -210,4 +162,4 @@ To see what is actually sent to and received from the server `Request` / `Respon
210162
<logger name="org.springframework.data.elasticsearch.client.WIRE" level="trace"/>
211163
----
212164

213-
NOTE: The above applies to both the `RestHighLevelClient` and `ReactiveElasticsearchClient` when obtained via `RestClients` respectively `ReactiveRestClients`, is not available for the `TransportClient`.
165+
NOTE: The above applies to both the `RestHighLevelClient` and `ReactiveElasticsearchClient` when obtained via `RestClients` respectively `ReactiveRestClients`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[[elasticsearch-migration-guide-4.3-4.4]]
2+
= Upgrading from 4.3.x to 4.4.x
3+
4+
This section describes breaking changes from version 4.3.x to 4.4.x and how removed features can be replaced by new introduced features.
5+
6+
[[elasticsearch-migration-guide-4.3-4.4.deprecations]]
7+
== Deprecations
8+
9+
[[elasticsearch-migration-guide-4.3-4.4.breaking-changes]]
10+
== Breaking Changes
11+
12+
=== Package changes
13+
14+
* The package `org.springframework.data.elasticsearch.core.clients.elasticsearch7` has been renamed to `org.springframework.data.elasticsearch.core.backend.elasticsearch7`.
15+
16+
=== Removal of deprecated classes
17+
18+
==== `ElasticsearchTemplate` has been removed
19+
20+
As of version 4.4 Spring Data Elasticsearch does not use the `TransportClient` from Elasticsearch anymore (which itself is deprecated since Elasticsearch 7.0).
21+
This means that the `ElasticsearchTemplate` class which was deprecated since Spring Data Elasticsearch 4.0 has been removed.
22+
This was the implementation of the `ElasticsearchOperations` interface that was using the `TransportClient`.
23+
Connections to Elasticsearch must be made using either the imperative `ElasticsearchRestTemplate` or the reactive `ReactiveElasticsearchTemplate`.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[[new-features.4-3-0]]
55
== New in Spring Data Elasticsearch 4.3
66

7-
* Upgrade to Elasticsearch 7.15.1.
7+
* Upgrade to Elasticsearch 7.15.2.
88
* Allow runtime_fields to be defined in the index mapping.
99
* Add native support for range field types by using a range object.
1010
* Add repository search for nullable or empty properties.

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

-34
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,6 @@ There is support for automatic creation of indices and writing the mappings when
3030
3131
====
3232

33-
[[elasticsearch.operations.template]]
34-
== ElasticsearchTemplate
35-
36-
NOTE: Usage of the ElasticsearchTemplate is deprecated as of version 4.0, use ElasticsearchRestTemplate instead.
37-
38-
The `ElasticsearchTemplate` is an implementation of the `ElasticsearchOperations` interface using the <<elasticsearch.clients.transport>>.
39-
40-
.ElasticsearchTemplate configuration
41-
====
42-
[source,java]
43-
----
44-
@Configuration
45-
public class TransportClientConfig extends ElasticsearchConfigurationSupport {
46-
47-
@Bean
48-
public Client elasticsearchClient() throws UnknownHostException { <1>
49-
Settings settings = Settings.builder().put("cluster.name", "elasticsearch").build();
50-
TransportClient client = new PreBuiltTransportClient(settings);
51-
client.addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
52-
return client;
53-
}
54-
55-
@Bean(name = {"elasticsearchOperations", "elasticsearchTemplate"})
56-
public ElasticsearchTemplate elasticsearchTemplate() throws UnknownHostException { <2>
57-
return new ElasticsearchTemplate(elasticsearchClient());
58-
}
59-
}
60-
----
61-
62-
<1> Setting up the <<elasticsearch.clients.transport>>.
63-
Deprecated as of version 4.0.
64-
<2> Creating the `ElasticsearchTemplate` bean, offering both names, _elasticsearchOperations_ and _elasticsearchTemplate_.
65-
====
66-
6733
[[elasticsearch.operations.resttemplate]]
6834
== ElasticsearchRestTemplate
6935

Diff for: src/main/java/org/springframework/data/elasticsearch/core/CriteriaFilterProcessor.java renamed to src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/CriteriaFilterProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.elasticsearch.core;
16+
package org.springframework.data.elasticsearch.backend.elasticsearch7;
1717

1818
import static org.springframework.data.elasticsearch.core.query.Criteria.*;
1919

Diff for: src/main/java/org/springframework/data/elasticsearch/core/CriteriaQueryProcessor.java renamed to src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/CriteriaQueryProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.elasticsearch.core;
16+
package org.springframework.data.elasticsearch.backend.elasticsearch7;
1717

1818
import static org.elasticsearch.index.query.Operator.*;
1919
import static org.elasticsearch.index.query.QueryBuilders.*;

Diff for: src/main/java/org/springframework/data/elasticsearch/core/clients/elasticsearch7/ElasticsearchAggregation.java renamed to src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/ElasticsearchAggregation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.elasticsearch.core.clients.elasticsearch7;
16+
package org.springframework.data.elasticsearch.backend.elasticsearch7;
1717

1818
import org.elasticsearch.search.aggregations.Aggregation;
1919
import org.springframework.data.elasticsearch.core.AggregationContainer;

Diff for: src/main/java/org/springframework/data/elasticsearch/core/clients/elasticsearch7/ElasticsearchAggregations.java renamed to src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/ElasticsearchAggregations.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.springframework.data.elasticsearch.core.clients.elasticsearch7;
16+
package org.springframework.data.elasticsearch.backend.elasticsearch7;
1717

1818
import org.elasticsearch.search.aggregations.Aggregations;
1919
import org.springframework.data.elasticsearch.core.AggregationsContainer;

0 commit comments

Comments
 (0)