mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-06-01 09:42:11 +00:00
parent
95e028a1e9
commit
8f8600727c
1
.gitignore
vendored
1
.gitignore
vendored
@ -30,7 +30,6 @@ target
|
|||||||
build/
|
build/
|
||||||
node_modules
|
node_modules
|
||||||
node
|
node
|
||||||
package.json
|
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
.mvn/.gradle-enterprise
|
.mvn/.gradle-enterprise
|
||||||
|
10
package.json
Normal file
10
package.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"antora": "3.2.0-alpha.6",
|
||||||
|
"@antora/atlas-extension": "1.0.0-alpha.2",
|
||||||
|
"@antora/collector-extension": "1.0.0-alpha.7",
|
||||||
|
"@asciidoctor/tabs": "1.0.0-beta.6",
|
||||||
|
"@springio/antora-extensions": "1.13.0",
|
||||||
|
"@springio/asciidoctor-extensions": "1.0.0-alpha.11"
|
||||||
|
}
|
||||||
|
}
|
2
pom.xml
2
pom.xml
@ -468,7 +468,7 @@
|
|||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.spring.maven.antora</groupId>
|
<groupId>org.antora</groupId>
|
||||||
<artifactId>antora-maven-plugin</artifactId>
|
<artifactId>antora-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
# The purpose of this Antora playbook is to build the docs in the current branch.
|
# The purpose of this Antora playbook is to build the docs in the current branch.
|
||||||
antora:
|
antora:
|
||||||
extensions:
|
extensions:
|
||||||
- '@antora/collector-extension'
|
- require: '@springio/antora-extensions'
|
||||||
- require: '@springio/antora-extensions/root-component-extension'
|
|
||||||
root_component_name: 'data-elasticsearch'
|
root_component_name: 'data-elasticsearch'
|
||||||
site:
|
site:
|
||||||
title: Spring Data Elasticsearch
|
title: Spring Data Elasticsearch
|
||||||
@ -22,13 +21,12 @@ content:
|
|||||||
start_path: src/main/antora
|
start_path: src/main/antora
|
||||||
asciidoc:
|
asciidoc:
|
||||||
attributes:
|
attributes:
|
||||||
page-pagination: ''
|
|
||||||
hide-uri-scheme: '@'
|
hide-uri-scheme: '@'
|
||||||
tabs-sync-option: '@'
|
tabs-sync-option: '@'
|
||||||
chomp: 'all'
|
|
||||||
extensions:
|
extensions:
|
||||||
- '@asciidoctor/tabs'
|
- '@asciidoctor/tabs'
|
||||||
- '@springio/asciidoctor-extensions'
|
- '@springio/asciidoctor-extensions'
|
||||||
|
- '@springio/asciidoctor-extensions/javadoc-extension'
|
||||||
sourcemap: true
|
sourcemap: true
|
||||||
urls:
|
urls:
|
||||||
latest_version_segment: ''
|
latest_version_segment: ''
|
||||||
@ -38,5 +36,5 @@ runtime:
|
|||||||
format: pretty
|
format: pretty
|
||||||
ui:
|
ui:
|
||||||
bundle:
|
bundle:
|
||||||
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.3.5/ui-bundle.zip
|
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip
|
||||||
snapshot: true
|
snapshot: true
|
||||||
|
@ -10,3 +10,8 @@ ext:
|
|||||||
local: true
|
local: true
|
||||||
scan:
|
scan:
|
||||||
dir: target/classes/
|
dir: target/classes/
|
||||||
|
- run:
|
||||||
|
command: ./mvnw package -Pdistribute
|
||||||
|
local: true
|
||||||
|
scan:
|
||||||
|
dir: target/antora
|
||||||
|
@ -41,4 +41,5 @@
|
|||||||
** xref:repositories/query-keywords-reference.adoc[]
|
** xref:repositories/query-keywords-reference.adoc[]
|
||||||
** xref:repositories/query-return-types-reference.adoc[]
|
** xref:repositories/query-return-types-reference.adoc[]
|
||||||
|
|
||||||
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki]
|
* xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank]
|
||||||
|
* https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank]
|
||||||
|
@ -31,7 +31,7 @@ public class MyClientConfig extends ElasticsearchConfiguration {
|
|||||||
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
|
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
|
||||||
====
|
====
|
||||||
|
|
||||||
The `ElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
|
The javadoc:org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration[]] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
|
||||||
|
|
||||||
|
|
||||||
The following beans can then be injected in other Spring components:
|
The following beans can then be injected in other Spring components:
|
||||||
@ -52,13 +52,13 @@ RestClient restClient; <.>
|
|||||||
JsonpMapper jsonpMapper; <.>
|
JsonpMapper jsonpMapper; <.>
|
||||||
----
|
----
|
||||||
|
|
||||||
<.> an implementation of `ElasticsearchOperations`
|
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[]
|
||||||
<.> the `co.elastic.clients.elasticsearch.ElasticsearchClient` that is used.
|
<.> the `co.elastic.clients.elasticsearch.ElasticsearchClient` that is used.
|
||||||
<.> the low level `RestClient` from the Elasticsearch libraries
|
<.> the low level `RestClient` from the Elasticsearch libraries
|
||||||
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
|
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
|
||||||
====
|
====
|
||||||
|
|
||||||
Basically one should just use the `ElasticsearchOperations` to interact with the Elasticsearch cluster.
|
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] to interact with the Elasticsearch cluster.
|
||||||
When using repositories, this instance is used under the hood as well.
|
When using repositories, this instance is used under the hood as well.
|
||||||
|
|
||||||
[[elasticsearch.clients.reactiverestclient]]
|
[[elasticsearch.clients.reactiverestclient]]
|
||||||
@ -86,7 +86,7 @@ public class MyClientConfig extends ReactiveElasticsearchConfiguration {
|
|||||||
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
|
<.> for a detailed description of the builder methods see xref:elasticsearch/clients.adoc#elasticsearch.clients.configuration[Client Configuration]
|
||||||
====
|
====
|
||||||
|
|
||||||
The `ReactiveElasticsearchConfiguration` class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
|
The javadoc:org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchConfiguration[] class allows further configuration by overriding for example the `jsonpMapper()` or `transportOptions()` methods.
|
||||||
|
|
||||||
The following beans can then be injected in other Spring components:
|
The following beans can then be injected in other Spring components:
|
||||||
|
|
||||||
@ -108,20 +108,20 @@ JsonpMapper jsonpMapper; <.>
|
|||||||
|
|
||||||
the following can be injected:
|
the following can be injected:
|
||||||
|
|
||||||
<.> an implementation of `ReactiveElasticsearchOperations`
|
<.> an implementation of javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[]
|
||||||
<.> the `org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient` that is used.
|
<.> the `org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient` that is used.
|
||||||
This is a reactive implementation based on the Elasticsearch client implementation.
|
This is a reactive implementation based on the Elasticsearch client implementation.
|
||||||
<.> the low level `RestClient` from the Elasticsearch libraries
|
<.> the low level `RestClient` from the Elasticsearch libraries
|
||||||
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
|
<.> the `JsonpMapper` user by the Elasticsearch `Transport`
|
||||||
====
|
====
|
||||||
|
|
||||||
Basically one should just use the `ReactiveElasticsearchOperations` to interact with the Elasticsearch cluster.
|
Basically one should just use the javadoc:org.springframework.data.elasticsearch.core.ReactiveElasticsearchOperations[] to interact with the Elasticsearch cluster.
|
||||||
When using repositories, this instance is used under the hood as well.
|
When using repositories, this instance is used under the hood as well.
|
||||||
|
|
||||||
[[elasticsearch.clients.configuration]]
|
[[elasticsearch.clients.configuration]]
|
||||||
== Client Configuration
|
== Client Configuration
|
||||||
|
|
||||||
Client behaviour can be changed via the `ClientConfiguration` that allows to set options for SSL, connect and socket timeouts, headers and other parameters.
|
Client behaviour can be changed via the javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] that allows to set options for SSL, connect and socket timeouts, headers and other parameters.
|
||||||
|
|
||||||
.Client Configuration
|
.Client Configuration
|
||||||
====
|
====
|
||||||
@ -178,7 +178,7 @@ If this is used in the reactive setup, the supplier function *must not* block!
|
|||||||
[[elasticsearch.clients.configuration.callbacks]]
|
[[elasticsearch.clients.configuration.callbacks]]
|
||||||
=== Client configuration callbacks
|
=== Client configuration callbacks
|
||||||
|
|
||||||
The `ClientConfiguration` class offers the most common parameters to configure the client.
|
The javadoc:org.springframework.data.elasticsearch.client.ClientConfiguration[] class offers the most common parameters to configure the client.
|
||||||
In the case this is not enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback<?>)` method.
|
In the case this is not enough, the user can add callback functions by using the `withClientConfigurer(ClientConfigurationCallback<?>)` method.
|
||||||
|
|
||||||
The following callbacks are provided:
|
The following callbacks are provided:
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
Spring Data Elasticsearch uses several interfaces to define the operations that can be called against an Elasticsearch index (for a description of the reactive interfaces see xref:elasticsearch/reactive-template.adoc[]).
|
Spring Data Elasticsearch uses several interfaces to define the operations that can be called against an Elasticsearch index (for a description of the reactive interfaces see xref:elasticsearch/reactive-template.adoc[]).
|
||||||
|
|
||||||
* `IndexOperations` defines actions on index level like creating or deleting an index.
|
* javadoc:org.springframework.data.elasticsearch.core.IndexOperations[] defines actions on index level like creating or deleting an index.
|
||||||
* `DocumentOperations` defines actions to store, update and retrieve entities based on their id.
|
* javadoc:org.springframework.data.elasticsearch.core.DocumentOperations[] defines actions to store, update and retrieve entities based on their id.
|
||||||
* `SearchOperations` define the actions to search for multiple entities using queries
|
* javadoc:org.springframework.data.elasticsearch.core.SearchOperations[] define the actions to search for multiple entities using queries
|
||||||
* `ElasticsearchOperations` combines the `DocumentOperations` and `SearchOperations` interfaces.
|
* javadoc:org.springframework.data.elasticsearch.core.ElasticsearchOperations[] combines the `DocumentOperations` and `SearchOperations` interfaces.
|
||||||
|
|
||||||
These interfaces correspond to the structuring of the https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html[Elasticsearch API].
|
These interfaces correspond to the structuring of the https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html[Elasticsearch API].
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ public class ClusterConnection implements ExtensionContext.Store.CloseableResour
|
|||||||
DockerImageName dockerImageName = getDockerImageName(testcontainersProperties);
|
DockerImageName dockerImageName = getDockerImageName(testcontainersProperties);
|
||||||
|
|
||||||
ElasticsearchContainer elasticsearchContainer = new SpringDataElasticsearchContainer(dockerImageName)
|
ElasticsearchContainer elasticsearchContainer = new SpringDataElasticsearchContainer(dockerImageName)
|
||||||
.withEnv(testcontainersProperties).withStartupTimeout(Duration.ofMinutes(2));
|
.withEnv(testcontainersProperties).withStartupTimeout(Duration.ofMinutes(2)).withReuse(true);
|
||||||
elasticsearchContainer.start();
|
elasticsearchContainer.start();
|
||||||
|
|
||||||
return ClusterConnectionInfo.builder() //
|
return ClusterConnectionInfo.builder() //
|
||||||
@ -192,16 +192,7 @@ public class ClusterConnection implements ExtensionContext.Store.CloseableResour
|
|||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
|
||||||
if (clusterConnectionInfo != null && clusterConnectionInfo.getElasticsearchContainer() != null) {
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Stopping container");
|
|
||||||
}
|
|
||||||
clusterConnectionInfo.getElasticsearchContainer().stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("closed");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class SpringDataElasticsearchContainer extends ElasticsearchContainer {
|
private static class SpringDataElasticsearchContainer extends ElasticsearchContainer {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user