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
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -137,7 +137,7 @@ If you want to raise an issue, please follow the recommendations below:
137
137
138
138
* Before you log a bug, please search the
139
139
https://github.com/spring-projects/spring-data-elasticsearch/issues[issue tracker] to see if someone has already reported the problem.
140
-
* If the issue doesn’t already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
140
+
* If the issue doesn't already exist, https://github.com/spring-projects/spring-data-elasticsearch/issues/new[create a new issue].
141
141
* 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.
142
142
* If you need to paste code, or include a stack trace use Markdown +++```+++ escapes before and after your text.
143
143
* If possible try to create a test-case or project that replicates the issue.
@@ -168,10 +168,10 @@ Building the documentation builds also the project without running tests.
168
168
169
169
[source,bash]
170
170
----
171
-
$ ./mvnw clean install -Pdistribute
171
+
$ ./mvnw clean install -Pantora
172
172
----
173
173
174
-
The generated documentation is available from `target/site/reference/html/index.html`.
174
+
The generated documentation is available from `target/antora/site/index.html`.
Spring Data support for Elasticsearch contains a wide range of features:
6
+
7
+
* Spring configuration support for various xref:elasticsearch/clients.adoc[Elasticsearch clients].
8
+
* The xref:elasticsearch/template.adoc[`ElasticsearchTemplate` and `ReactiveElasticsearchTemplate`] helper classes that provide object mapping between ES index operations and POJOs.
9
+
* xref:elasticsearch/template.adoc#exception-translation[Exception translation] into Spring's portable {springDocsUrl}data-access.html#dao-exceptions[Data Access Exception Hierarchy].
10
+
* Feature rich xref:elasticsearch/object-mapping.adoc[object mapping] integrated with _Spring's_ {springDocsUrl}core.html#core-convert[Conversion Service].
11
+
* xref:elasticsearch/object-mapping.adoc#elasticsearch.mapping.meta-model.annotations[Annotation-based mapping] metadata that is extensible to support other metadata formats.
12
+
* Java-based xref:elasticsearch/template.adoc#cassandra.template.query[query, criteria, and update DSLs].
13
+
* Automatic implementation of xref:repositories.adoc[imperative and reactive `Repository` interfaces] including support for xref:repositories/custom-implementations.adoc[custom query methods].
14
+
15
+
For most data-oriented tasks, you can use the `[Reactive]ElasticsearchTemplate` or the `Repository` support, both of which use the rich object-mapping functionality.
16
+
Spring Data Elasticsearch uses consistent naming conventions on objects in various APIs to those found in the DataStax Java Driver so that they are familiar and so that you can map your existing knowledge onto the Spring APIs.
Copy file name to clipboardExpand all lines: src/main/antora/modules/ROOT/pages/elasticsearch/auditing.adoc
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
[[elasticsearch.auditing]]
2
-
==Elasticsearch Auditing
2
+
= Elasticsearch Auditing
3
3
4
4
[[elasticsearch.auditing.preparing]]
5
-
=== Preparing entities
5
+
== Preparing entities
6
6
7
7
In order for the auditing code to be able to decide whether an entity instance is new, the entity must implement the `Persistable<ID>` interface which is defined as follows:
8
8
@@ -56,7 +56,7 @@ public class Person implements Persistable<Long> {
56
56
<.> an object is new if it either has no `id` or none of fields containing creation attributes are set.
57
57
58
58
[[elasticsearch.auditing.activating]]
59
-
=== Activating auditing
59
+
== Activating auditing
60
60
61
61
After the entities have been set up and providing the `AuditorAware` - or `ReactiveAuditorAware` - the Auditing must be activated by setting the `@EnableElasticsearchAuditing` on a configuration class:
Copy file name to clipboardExpand all lines: src/main/antora/modules/ROOT/pages/elasticsearch/clients.adoc
+19-21Lines changed: 19 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,8 @@
3
3
4
4
This chapter illustrates configuration and usage of supported Elasticsearch client implementations.
5
5
6
-
Spring Data Elasticsearch operates upon an Elasticsearch client (provided by Elasticsearch client libraries) that is
7
-
connected to a single Elasticsearch node or a cluster.
8
-
Although the Elasticsearch Client can be used directly to work with the cluster, applications using Spring Data
9
-
Elasticsearch normally use the higher level abstractions of <<elasticsearch.operations>> and <<elasticsearch.repositories>>.
6
+
Spring Data Elasticsearch operates upon an Elasticsearch client (provided by Elasticsearch client libraries) that is connected to a single Elasticsearch node or a cluster.
7
+
Although the Elasticsearch Client can be used directly to work with the cluster, applications using Spring Data Elasticsearch normally use the higher level abstractions of xref:elasticsearch/template.adoc[Elasticsearch Operations] and xref:elasticsearch/repositories/elasticsearch-repositories.adoc[Elasticsearch Repositories].
10
8
11
9
[[elasticsearch.clients.restclient]]
12
10
== Imperative Rest Client
@@ -23,13 +21,14 @@ public class MyClientConfig extends ElasticsearchConfiguration {
23
21
24
22
@Override
25
23
public ClientConfiguration clientConfiguration() {
26
-
return ClientConfiguration.builder() <.>
27
-
.connectedTo("localhost:9200")
24
+
return ClientConfiguration.builder() <.>
25
+
.connectedTo("localhost:9200")
28
26
.build();
29
27
}
30
28
}
31
29
----
32
-
<.> for a detailed description of the builder methods see <<elasticsearch.clients.configuration>>
30
+
31
+
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
33
32
====
34
33
35
34
The `ElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
@@ -43,14 +42,14 @@ The following beans can then be injected in other Spring components:
<.> an implementation of `ElasticsearchOperations`
@@ -78,12 +77,13 @@ public class MyClientConfig extends ReactiveElasticsearchConfiguration {
78
77
@Override
79
78
public ClientConfiguration clientConfiguration() {
80
79
return ClientConfiguration.builder() <.>
81
-
.connectedTo("localhost:9200")
80
+
.connectedTo("localhost:9200")
82
81
.build();
83
82
}
84
83
}
85
84
----
86
-
<.> for a detailed description of the builder methods see <<elasticsearch.clients.configuration>>
85
+
86
+
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
87
87
====
88
88
89
89
The `ReactiveElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
@@ -96,14 +96,14 @@ The following beans can then be injected in other Spring components:
<.> Define default headers, if they need to be customized
163
163
<.> Use the builder to provide cluster addresses, set default `HttpHeaders` or enable SSL.
164
-
<.> Optionally enable SSL.There exist overloads of this function that can take a `SSLContext` or as an alternative the fingerprint of the certificate as it is output by Elasticsearch 8 on startup.
164
+
<.> Optionally enable SSL.There exist overloads of this function that can take a `SSLContext` or as an alternative the fingerprint of the certificate as it is output by Elasticsearch 8 on startup.
165
165
<.> Optionally set a proxy.
166
166
<.> Optionally set a path prefix, mostly used when different clusters a behind some reverse proxy.
167
167
<.> Set the connection timeout.
168
168
<.> Set the socket timeout.
169
169
<.> Optionally set headers.
170
170
<.> Add basic authentication.
171
171
<.> A `Supplier<HttpHeaders>` function can be specified which is called every time before a request is sent to Elasticsearch - here, as an example, the current time is written in a header.
172
-
<.> a function to configure the created client (see <<elasticsearch.clients.configuration.callbacks>>), can be added
173
-
multiple times.
172
+
<.> a function to configure the created client (see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration.callbacks[Client configuration callbacks]), can be added multiple times.
174
173
====
175
174
176
175
IMPORTANT: Adding a Header supplier as shown in above example allows to inject headers that may change over the time, like authentication JWT tokens.
@@ -179,8 +178,8 @@ If this is used in the reactive setup, the supplier function *must not* block!
179
178
[[elasticsearch.clients.configuration.callbacks]]
180
179
=== Client configuration callbacks
181
180
182
-
The `ClientConfiguration` class offers the most common parameters to configure the client. In the case this is not
183
-
enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback<?>)` method.
181
+
The `ClientConfiguration` class offers the most common parameters to configure the client.
182
+
In the case this is not enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback<?>)` method.
184
183
185
184
The following callbacks are provided:
186
185
@@ -222,9 +221,8 @@ ClientConfiguration.builder()
222
221
[[elasticsearch.clients.logging]]
223
222
== Client Logging
224
223
225
-
To see what is actually sent to and received from the server `Request` / `Response` logging on the transport level
226
-
needs to be turned on as outlined in the snippet below. This can be enabled in the Elasticsearch client by setting
227
-
the level of the `tracer` package to "trace" (see
224
+
To see what is actually sent to and received from the server `Request` / `Response` logging on the transport level needs to be turned on as outlined in the snippet below.
225
+
This can be enabled in the Elasticsearch client by setting the level of the `tracer` package to "trace" (see
0 commit comments