You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+15-36
Original file line number
Diff line number
Diff line change
@@ -4,22 +4,26 @@ image:https://spring.io/badges/spring-data-elasticsearch/ga.svg[Spring Data Elas
4
4
5
5
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.
6
6
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.
8
9
9
10
This project is lead and maintained by the community.
10
11
11
12
== Features
12
13
13
14
* 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.
15
17
* Feature Rich Object Mapping integrated with Spring’s Conversion Service
16
18
* Annotation based mapping metadata
17
19
* Automatic implementation of `Repository` interfaces including support for custom search methods.
18
20
* CDI support for repositories
19
21
20
22
== Code of Conduct
21
23
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.
public ElasticsearchTemplate elasticsearchTemplate() throws UnknownHostException {
81
-
return new ElasticsearchTemplate(elasticsearchClient());
82
-
}
83
-
}
84
-
----
85
-
86
65
=== Using the RestClient
87
66
88
67
Provide a configuration like this:
@@ -161,7 +140,8 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
161
140
162
141
== Getting Help
163
142
164
-
Having trouble with Spring Data? We’d love to help!
143
+
Having trouble with Spring Data?
144
+
We’d love to help!
165
145
166
146
* Check the
167
147
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
174
154
175
155
== Reporting Issues
176
156
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:
178
159
179
160
* Before you log a bug, please search the
180
161
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
181
162
* If the issue doesn’t already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
182
163
* 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.
183
164
* 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.
185
167
186
168
== Building from Source
187
169
@@ -197,11 +179,8 @@ If you want to build with the regular `mvn` command, you will need https://maven
197
179
198
180
_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._
199
181
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.
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/elasticsearch-clients.adoc
+2-50
Original file line number
Diff line number
Diff line change
@@ -6,58 +6,10 @@ This chapter illustrates configuration and usage of supported Elasticsearch clie
6
6
Spring Data Elasticsearch operates upon an Elasticsearch client that is connected to a single Elasticsearch node or a cluster.
7
7
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>>.
8
8
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 {
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
-
56
9
[[elasticsearch.clients.rest]]
57
10
== High Level REST Client
58
11
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:
61
13
62
14
.High Level REST Client
63
15
====
@@ -210,4 +162,4 @@ To see what is actually sent to and received from the server `Request` / `Respon
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`.
* 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`.
Copy file name to clipboardExpand all lines: src/main/java/org/springframework/data/elasticsearch/backend/elasticsearch7/ElasticsearchAggregations.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
* See the License for the specific language governing permissions and
0 commit comments