Class ReactiveIndicesTemplate
java.lang.Object
org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate<co.elastic.clients.transport.ElasticsearchTransport,ReactiveElasticsearchIndicesClient>
org.springframework.data.elasticsearch.client.elc.ReactiveIndicesTemplate
- All Implemented Interfaces:
ReactiveIndexOperations
public class ReactiveIndicesTemplate
extends ReactiveChildTemplate<co.elastic.clients.transport.ElasticsearchTransport,ReactiveElasticsearchIndicesClient>
implements ReactiveIndexOperations
- Author:
- Peter-Josef Meisch
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
ReactiveChildTemplate.ClientCallback<CLIENT,
RESULT extends org.reactivestreams.Publisher<?>> -
Field Summary
Fields inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
client, elasticsearchConverter, exceptionTranslator, requestConverter, responseConverter
-
Constructor Summary
ConstructorDescriptionReactiveIndicesTemplate
(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, Class<?> clazz) ReactiveIndicesTemplate
(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, IndexCoordinates index) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Boolean>
alias
(AliasActions aliasActions) Executes the givenAliasActions
.reactor.core.publisher.Mono<Boolean>
create()
Create an index.reactor.core.publisher.Mono<Boolean>
Create an index with the specified settings.reactor.core.publisher.Mono<Boolean>
Create an index for given settings and mapping.reactor.core.publisher.Mono<Document>
Creates the index mapping for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Document>
createMapping
(Class<?> clazz) Creates the index mapping for the given classreactor.core.publisher.Mono<Settings>
Creates the index settings for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Settings>
createSettings
(Class<?> clazz) Creates the index settings from the annotations on the given classreactor.core.publisher.Mono<Boolean>
Create an index with the settings and mapping defined for the entity this IndexOperations is bound to.reactor.core.publisher.Mono<Boolean>
delete()
Delete an index.reactor.core.publisher.Mono<Boolean>
deleteComponentTemplate
(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Deletes a component index template.reactor.core.publisher.Mono<Boolean>
deleteIndexTemplate
(DeleteIndexTemplateRequest deleteIndexTemplateRequest) Deletes an index template.reactor.core.publisher.Mono<Boolean>
deleteTemplate
(DeleteTemplateRequest deleteTemplateRequest) Deletes an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)reactor.core.publisher.Mono<Boolean>
exists()
checks if an index existsreactor.core.publisher.Mono<Boolean>
existsComponentTemplate
(ExistsComponentTemplateRequest existsComponentTemplateRequest) Checks wether a component index template exists.reactor.core.publisher.Mono<Boolean>
existsIndexTemplate
(ExistsIndexTemplateRequest existsIndexTemplateRequest) Checks if an index template exists.reactor.core.publisher.Mono<Boolean>
existsTemplate
(ExistsTemplateRequest existsTemplateRequest) Checks if an index template exists using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)getAliases
(String... aliasNames) gets information about aliasesgetAliasesForIndex
(String... indexNames) gets information about aliasesreactor.core.publisher.Flux<TemplateResponse>
getComponentTemplate
(GetComponentTemplateRequest getComponentTemplateRequest) Get component template(s).get the currentIndexCoordinates
.reactor.core.publisher.Flux<TemplateResponse>
getIndexTemplate
(GetIndexTemplateRequest getIndexTemplateRequest) Get index template(s).reactor.core.publisher.Flux<IndexInformation>
getInformation
(IndexCoordinates index) Gets theIndexInformation
for the indices defined byReactiveIndexOperations.getIndexCoordinates()
.reactor.core.publisher.Mono<Document>
Get mapping for the index targeted defined by thisReactiveIndexOperations
reactor.core.publisher.Mono<Settings>
getSettings
(boolean includeDefaults) get the settings for the indexreactor.core.publisher.Mono<TemplateData>
getTemplate
(GetTemplateRequest getTemplateRequest) gets an index template using the legacy Elasticsearch interface.reactor.core.publisher.Mono<Boolean>
putComponentTemplate
(PutComponentTemplateRequest putComponentTemplateRequest) Writes a component index template that can be used in a composable index template.reactor.core.publisher.Mono<Boolean>
putIndexTemplate
(PutIndexTemplateRequest putIndexTemplateRequest) Creates an index template.reactor.core.publisher.Mono<Boolean>
putMapping
(reactor.core.publisher.Mono<Document> mapping) writes a mapping to the indexreactor.core.publisher.Mono<Boolean>
putTemplate
(PutTemplateRequest putTemplateRequest) Creates an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)reactor.core.publisher.Mono<Void>
refresh()
Refresh the index(es) this IndexOperations is bound toMethods inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
execute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.elasticsearch.core.ReactiveIndexOperations
deleteIndexTemplate, deleteTemplate, existsIndexTemplate, existsTemplate, getIndexTemplate, getInformation, getSettings, getTemplate, putMapping, putMapping
-
Constructor Details
-
ReactiveIndicesTemplate
public ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, IndexCoordinates index) -
ReactiveIndicesTemplate
public ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, Class<?> clazz)
-
-
Method Details
-
create
Description copied from interface:ReactiveIndexOperations
Create an index.- Specified by:
create
in interfaceReactiveIndexOperations
- Returns:
- a
Mono
signalling successful operation completion or anerror
if eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperations
Create an index with the specified settings.- Specified by:
create
in interfaceReactiveIndexOperations
- Parameters:
settings
- index settings- Returns:
- a
Mono
signalling successful operation completion or anerror
if eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperations
Create an index for given settings and mapping.- Specified by:
create
in interfaceReactiveIndexOperations
- Parameters:
settings
- the index settingsmapping
- the index mapping- Returns:
- a
Mono
signalling successful operation completion or anerror
if eg. the index already exist.
-
createWithMapping
Description copied from interface:ReactiveIndexOperations
Create an index with the settings and mapping defined for the entity this IndexOperations is bound to.- Specified by:
createWithMapping
in interfaceReactiveIndexOperations
- Returns:
- a
Mono
signalling successful operation completion or anerror
if eg. the index already exist.
-
delete
Description copied from interface:ReactiveIndexOperations
Delete an index.- Specified by:
delete
in interfaceReactiveIndexOperations
- Returns:
- a
Mono
signalling operation completion or anerror
. If the index does not exist, a value of false is emitted.
-
exists
Description copied from interface:ReactiveIndexOperations
checks if an index exists- Specified by:
exists
in interfaceReactiveIndexOperations
- Returns:
- a
Mono
with the result of exist check
-
refresh
Description copied from interface:ReactiveIndexOperations
Refresh the index(es) this IndexOperations is bound to- Specified by:
refresh
in interfaceReactiveIndexOperations
- Returns:
- a
Mono
signalling operation completion.
-
createMapping
Description copied from interface:ReactiveIndexOperations
Creates the index mapping for the entity this IndexOperations is bound to.- Specified by:
createMapping
in interfaceReactiveIndexOperations
- Returns:
- mapping object
-
createMapping
Description copied from interface:ReactiveIndexOperations
Creates the index mapping for the given class- Specified by:
createMapping
in interfaceReactiveIndexOperations
- Parameters:
clazz
- the clazz to create a mapping for- Returns:
- a
Mono
with the mapping document
-
putMapping
public reactor.core.publisher.Mono<Boolean> putMapping(reactor.core.publisher.Mono<Document> mapping) Description copied from interface:ReactiveIndexOperations
writes a mapping to the index- Specified by:
putMapping
in interfaceReactiveIndexOperations
- Parameters:
mapping
- the Document with the mapping definitions- Returns:
- true if the mapping could be stored
-
getMapping
Description copied from interface:ReactiveIndexOperations
Get mapping for the index targeted defined by thisReactiveIndexOperations
- Specified by:
getMapping
in interfaceReactiveIndexOperations
- Returns:
- the mapping
-
createSettings
Description copied from interface:ReactiveIndexOperations
Creates the index settings for the entity this IndexOperations is bound to.- Specified by:
createSettings
in interfaceReactiveIndexOperations
- Returns:
- a settings document.
-
createSettings
Description copied from interface:ReactiveIndexOperations
Creates the index settings from the annotations on the given class- Specified by:
createSettings
in interfaceReactiveIndexOperations
- Parameters:
clazz
- the class to create the index settings from- Returns:
- a settings document.
-
getSettings
Description copied from interface:ReactiveIndexOperations
get the settings for the index- Specified by:
getSettings
in interfaceReactiveIndexOperations
- Parameters:
includeDefaults
- whether or not to include all the default settings- Returns:
- a
Mono
with aDocument
containing the index settings
-
alias
Description copied from interface:ReactiveIndexOperations
Executes the givenAliasActions
.- Specified by:
alias
in interfaceReactiveIndexOperations
- Parameters:
aliasActions
- the actions to execute- Returns:
- if the operation is acknowledged by Elasticsearch
-
getAliases
Description copied from interface:ReactiveIndexOperations
gets information about aliases- Specified by:
getAliases
in interfaceReactiveIndexOperations
- Parameters:
aliasNames
- alias names, must not be null- Returns:
- a
Mono
ofMap
from index names toAliasData
for that index
-
getAliasesForIndex
public reactor.core.publisher.Mono<Map<String,Set<AliasData>>> getAliasesForIndex(String... indexNames) Description copied from interface:ReactiveIndexOperations
gets information about aliases- Specified by:
getAliasesForIndex
in interfaceReactiveIndexOperations
- Parameters:
indexNames
- alias names, must not be null- Returns:
- a
Mono
ofMap
from index names toAliasData
for that index
-
putTemplate
Description copied from interface:ReactiveIndexOperations
Creates an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
putTemplate
in interfaceReactiveIndexOperations
- Parameters:
putTemplateRequest
- template request parameters- Returns:
- Mono of true if the template could be stored
-
putComponentTemplate
public reactor.core.publisher.Mono<Boolean> putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest) Description copied from interface:ReactiveIndexOperations
Writes a component index template that can be used in a composable index template.- Specified by:
putComponentTemplate
in interfaceReactiveIndexOperations
- Parameters:
putComponentTemplateRequest
- index template request parameters- Returns:
- true if successful
-
getComponentTemplate
public reactor.core.publisher.Flux<TemplateResponse> getComponentTemplate(GetComponentTemplateRequest getComponentTemplateRequest) Description copied from interface:ReactiveIndexOperations
Get component template(s).- Specified by:
getComponentTemplate
in interfaceReactiveIndexOperations
- Parameters:
getComponentTemplateRequest
- the getComponentTemplateRequest parameters- Returns:
- a
Flux
ofTemplateResponse
-
existsComponentTemplate
public reactor.core.publisher.Mono<Boolean> existsComponentTemplate(ExistsComponentTemplateRequest existsComponentTemplateRequest) Description copied from interface:ReactiveIndexOperations
Checks wether a component index template exists.- Specified by:
existsComponentTemplate
in interfaceReactiveIndexOperations
- Parameters:
existsComponentTemplateRequest
- the parameters for the request- Returns:
- Mono with the value if the componentTemplate exists.
-
deleteComponentTemplate
public reactor.core.publisher.Mono<Boolean> deleteComponentTemplate(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Description copied from interface:ReactiveIndexOperations
Deletes a component index template.- Specified by:
deleteComponentTemplate
in interfaceReactiveIndexOperations
- Parameters:
deleteComponentTemplateRequest
- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
putIndexTemplate
public reactor.core.publisher.Mono<Boolean> putIndexTemplate(PutIndexTemplateRequest putIndexTemplateRequest) Description copied from interface:ReactiveIndexOperations
Creates an index template.- Specified by:
putIndexTemplate
in interfaceReactiveIndexOperations
- Parameters:
putIndexTemplateRequest
- template request parameters- Returns:
- true if successful
-
existsIndexTemplate
public reactor.core.publisher.Mono<Boolean> existsIndexTemplate(ExistsIndexTemplateRequest existsIndexTemplateRequest) Description copied from interface:ReactiveIndexOperations
Checks if an index template exists.- Specified by:
existsIndexTemplate
in interfaceReactiveIndexOperations
- Parameters:
existsIndexTemplateRequest
- the parameters for the request- Returns:
- Mono with the value if the index template exists.
-
getIndexTemplate
public reactor.core.publisher.Flux<TemplateResponse> getIndexTemplate(GetIndexTemplateRequest getIndexTemplateRequest) Description copied from interface:ReactiveIndexOperations
Get index template(s).- Specified by:
getIndexTemplate
in interfaceReactiveIndexOperations
- Returns:
- a
Flux
ofTemplateResponse
-
deleteIndexTemplate
public reactor.core.publisher.Mono<Boolean> deleteIndexTemplate(DeleteIndexTemplateRequest deleteIndexTemplateRequest) Description copied from interface:ReactiveIndexOperations
Deletes an index template.- Specified by:
deleteIndexTemplate
in interfaceReactiveIndexOperations
- Parameters:
deleteIndexTemplateRequest
- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
getTemplate
Description copied from interface:ReactiveIndexOperations
gets an index template using the legacy Elasticsearch interface.- Specified by:
getTemplate
in interfaceReactiveIndexOperations
- Parameters:
getTemplateRequest
- the request parameters- Returns:
- Mono of TemplateData, Mono.empty() if no template with the given name exists.
-
existsTemplate
public reactor.core.publisher.Mono<Boolean> existsTemplate(ExistsTemplateRequest existsTemplateRequest) Description copied from interface:ReactiveIndexOperations
Checks if an index template exists using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
existsTemplate
in interfaceReactiveIndexOperations
- Parameters:
existsTemplateRequest
- template request parameters- Returns:
- Mono of true if the template exists
-
deleteTemplate
public reactor.core.publisher.Mono<Boolean> deleteTemplate(DeleteTemplateRequest deleteTemplateRequest) Description copied from interface:ReactiveIndexOperations
Deletes an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
deleteTemplate
in interfaceReactiveIndexOperations
- Parameters:
deleteTemplateRequest
- template request parameters- Returns:
- Mono of true if the template could be deleted
-
getInformation
Description copied from interface:ReactiveIndexOperations
Gets theIndexInformation
for the indices defined byReactiveIndexOperations.getIndexCoordinates()
.- Specified by:
getInformation
in interfaceReactiveIndexOperations
- Returns:
- a flux of
IndexInformation
-
getIndexCoordinates
Description copied from interface:ReactiveIndexOperations
get the currentIndexCoordinates
. These may change over time when the entity class has a SpEL constructed index name. When this IndexOperations is not bound to a class, the bound IndexCoordinates are returned.- Specified by:
getIndexCoordinates
in interfaceReactiveIndexOperations
- Returns:
- IndexCoordinates
-