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: CONTRIBUTING.adoc
-4Lines changed: 0 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,3 @@ Do not submit a Pull Request before having created an issue and having discussed
8
8
== Running the test locally
9
9
10
10
In order to run the tests locally with `./mvnw test` you need to have docker running because Spring Data Elasticsearch uses https://www.testcontainers.org/[Testcontainers] to start a local running Elasticsearch instance.
11
-
12
-
== Class names of the test classes
13
-
14
-
Test classes that do depend on the client have either `ERHLC` (when using the deprecated Elasticsearch `RestHighLevelClient`) or `ELC` (the new `ElasticsearchClient`) in their name.
Copy file name to clipboardExpand all lines: README.adoc
+3-46Lines changed: 3 additions & 46 deletions
Original file line number
Diff line number
Diff line change
@@ -5,42 +5,20 @@ image:https://spring.io/badges/spring-data-elasticsearch/ga.svg[Spring Data Elas
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
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
+
Key functional areas of Spring Data Elasticsearch are a POJO centric model for interacting with Elasticsearch Documents and easily writing a Repository style data access layer.
9
9
10
10
This project is lead and maintained by the community.
11
11
12
12
== Features
13
13
14
-
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for a ES clients instances.
14
+
* Spring configuration support using Java based `@Configuration` classes or an XML namespace for an ES client instances.
15
15
* `ElasticsearchOperations` class and implementations that increases productivity performing common ES operations.
16
16
Includes integrated object mapping between documents and POJOs.
17
17
* Feature Rich Object Mapping integrated with Spring’s Conversion Service
18
18
* Annotation based mapping metadata
19
19
* Automatic implementation of `Repository` interfaces including support for custom search methods.
20
20
* CDI support for repositories
21
21
22
-
== About Elasticsearch versions and clients
23
-
24
-
=== Elasticsearch 7.17 client libraries
25
-
26
-
At the end of 2021 Elasticsearch with version 7.17 released the new version of their Java client and deprecated the `RestHighLevelCLient` which was the default way to access Elasticsearch up to then.
27
-
28
-
Spring Data Elasticsearch will in version 4.4 offer the possibility to optionally use the new client as an alternative to the existing setup using the `RestHighLevelCLient`.
29
-
The default client that is used still is the `RestHighLevelCLient`, first because the integration of the new client is not yet complete, the new client still has features missing and bugs which will hopefully be resolved soon.
30
-
Second, and more important, the new Elasticsearch client forces users to switch from using `javax.json.spi.JsonProvider` to `jakarta.json.spi.JsonProvider`.
31
-
Spring Data Elasticsearch cannot enforce this switch; Spring Boot will switch to `jakarta` with version 3 and then it's safe for Spring Data Elasticsearch to switch to the new client.
32
-
33
-
So for version 4.4 Spring Data Elasticsearch will keep using the `RestHighLevelCLient` in version 7.17.x (as long as this will be available).
34
-
35
-
=== Elasticsearch 8 client libraries
36
-
37
-
In Elasticsearch 8, the `RestHighLevelCLient` has been removed.
38
-
This means that a switch to this client version can only be done with the next major upgrade which will be Spring Data Elasticsearch 5, based on Spring Data 3, used by Spring Boot 3, based on Spring 6 and Java 17.
39
-
40
-
=== Elasticsearch 8 cluster
41
-
42
-
It should be possible to use the Elasticsearch 7 client to access a cluster running version 8 by setting the appropriate compatibility headers (see the documentation at https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration). but I encountered and heard of cases where the response from the server is not parseable by the client although the headers are set, so use with care.
43
-
44
22
== Code of Conduct
45
23
46
24
This project is governed by the https://github.com/spring-projects/.github/blob/e3cc2ff230d8f1dca06535aa6b5a4a23815861d4/CODE_OF_CONDUCT.md[Spring Code of Conduct].
@@ -86,25 +64,7 @@ public class MyService {
86
64
87
65
=== Using the RestClient
88
66
89
-
Provide a configuration like this:
90
-
91
-
[source,java]
92
-
----
93
-
@Configuration
94
-
public class RestClientConfig extends AbstractElasticsearchConfiguration {
95
-
96
-
@Override
97
-
@Bean
98
-
public RestHighLevelClient elasticsearchClient() {
99
-
100
-
final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
Please check the [official documentation](https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#elasticsearch.clients.configuration).
108
68
109
69
=== Maven configuration
110
70
@@ -119,9 +79,6 @@ Add the Maven dependency:
119
79
</dependency>
120
80
----
121
81
122
-
// NOTE: since Github does not support include directives, the content of
123
-
// the src/main/asciidoc/reference/preface.adoc file is duplicated here
124
-
// Always change both files!
125
82
**Compatibility Matrix**
126
83
127
84
The compatibility between Spring Data Elasticsearch, Elasticsearch client drivers and Spring Boot versions can be found in the https://docs.spring.io/spring-data/elasticsearch/docs/current/reference/html/#preface.versions[reference documentation].
When using the deprecated `RestHighLevelClient` and accessing an Elasticsearch cluster that is running on version 8, it is necessary to set the compatibility headers
* All the code using the old deprecated `RestHighLevelClient` has been removed.
15
+
The default Elasticsearch client used since version 5.0 is the (not so) new Elasticsearch Java client.
16
+
* The `org.springframework.data.elasticsearch.client.ClientLogger` class has been removed.
17
+
This logger was configured with the `org.springframework.data.elasticsearch.client.WIRE` setting, but was not working with all clients.
18
+
From version 5 on, use the trace logger available in the Elasticsearch Java client, see <<elasticsearch.clients.logging>>.
19
+
* The method `org.springframework.data.elasticsearch.core.ElasticsearchOperations.stringIdRepresentation(Object)` has been removed, use the `convertId(Object)` method defined in the same interface instead.
20
+
* The class `org.springframework.data.elasticsearch.core.Range` has been removed, use `org.springframework.data.domain.Range` instead.
21
+
* The methods `org.springframework.data.elasticsearch.core.query.IndexQuery.getParentId() and `setParentId(String)` have been removed, they werent used anymore and were no-ops. It has been removed from the `org.springframework.data.elasticsearch.core.query.IndexQuery` class as well.
0 commit comments