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 Publisher<?>> -
Field Summary
Fields inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
client, elasticsearchConverter, exceptionTranslator, requestConverter, responseConverter -
Constructor Summary
ConstructorsConstructorDescriptionReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, Class<?> clazz) ReactiveIndicesTemplate(ReactiveElasticsearchIndicesClient client, ReactiveClusterTemplate clusterTemplate, ElasticsearchConverter elasticsearchConverter, IndexCoordinates index) -
Method Summary
Modifier and TypeMethodDescriptionalias(AliasActions aliasActions) Executes the givenAliasActions.create()Create an index.Create an index with the specified settings.Create an index for given settings and mapping.Creates the index mapping for the entity this IndexOperations is bound to.createMapping(Class<?> clazz) Creates the index mapping for the given classCreates the index settings for the entity this IndexOperations is bound to.createSettings(Class<?> clazz) Creates the index settings from the annotations on the given classCreate an index with the settings and mapping defined for the entity this IndexOperations is bound to.delete()Delete an index.deleteComponentTemplate(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Deletes a component index template.deleteIndexTemplate(DeleteIndexTemplateRequest deleteIndexTemplateRequest) Deletes an index template.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)exists()checks if an index existsexistsComponentTemplate(ExistsComponentTemplateRequest existsComponentTemplateRequest) Checks wether a component index template exists.existsIndexTemplate(ExistsIndexTemplateRequest existsIndexTemplateRequest) Checks if an index template exists.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 aliasesgetComponentTemplate(GetComponentTemplateRequest getComponentTemplateRequest) Get component template(s).get the currentIndexCoordinates.getIndexTemplate(GetIndexTemplateRequest getIndexTemplateRequest) Get index template(s).getInformation(IndexCoordinates index) Gets theIndexInformationfor the indices defined byReactiveIndexOperations.getIndexCoordinates().Get mapping for the index targeted defined by thisReactiveIndexOperationsgetSettings(boolean includeDefaults) get the settings for the indexgetTemplate(GetTemplateRequest getTemplateRequest) gets an index template using the legacy Elasticsearch interface.putComponentTemplate(PutComponentTemplateRequest putComponentTemplateRequest) Writes a component index template that can be used in a composable index template.putIndexTemplate(PutIndexTemplateRequest putIndexTemplateRequest) Creates an index template.putMapping(Mono<Document> mapping) writes a mapping to the indexputTemplate(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)refresh()Refresh the index(es) this IndexOperations is bound toMethods inherited from class org.springframework.data.elasticsearch.client.elc.ReactiveChildTemplate
executeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ReactiveIndexOperationsCreate an index.- Specified by:
createin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperationsCreate an index with the specified settings.- Specified by:
createin interfaceReactiveIndexOperations- Parameters:
settings- index settings- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
create
Description copied from interface:ReactiveIndexOperationsCreate an index for given settings and mapping.- Specified by:
createin interfaceReactiveIndexOperations- Parameters:
settings- the index settingsmapping- the index mapping- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
createWithMapping
Description copied from interface:ReactiveIndexOperationsCreate an index with the settings and mapping defined for the entity this IndexOperations is bound to.- Specified by:
createWithMappingin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling successful operation completion or anerrorif eg. the index already exist.
-
delete
Description copied from interface:ReactiveIndexOperationsDelete an index.- Specified by:
deletein interfaceReactiveIndexOperations- Returns:
- a
Monosignalling operation completion or anerror. If the index does not exist, a value of false is emitted.
-
exists
Description copied from interface:ReactiveIndexOperationschecks if an index exists- Specified by:
existsin interfaceReactiveIndexOperations- Returns:
- a
Monowith the result of exist check
-
refresh
Description copied from interface:ReactiveIndexOperationsRefresh the index(es) this IndexOperations is bound to- Specified by:
refreshin interfaceReactiveIndexOperations- Returns:
- a
Monosignalling operation completion.
-
createMapping
Description copied from interface:ReactiveIndexOperationsCreates the index mapping for the entity this IndexOperations is bound to.- Specified by:
createMappingin interfaceReactiveIndexOperations- Returns:
- mapping object
-
createMapping
Description copied from interface:ReactiveIndexOperationsCreates the index mapping for the given class- Specified by:
createMappingin interfaceReactiveIndexOperations- Parameters:
clazz- the clazz to create a mapping for- Returns:
- a
Monowith the mapping document
-
putMapping
Description copied from interface:ReactiveIndexOperationswrites a mapping to the index- Specified by:
putMappingin interfaceReactiveIndexOperations- Parameters:
mapping- the Document with the mapping definitions- Returns:
- true if the mapping could be stored
-
getMapping
Description copied from interface:ReactiveIndexOperationsGet mapping for the index targeted defined by thisReactiveIndexOperations- Specified by:
getMappingin interfaceReactiveIndexOperations- Returns:
- the mapping
-
createSettings
Description copied from interface:ReactiveIndexOperationsCreates the index settings for the entity this IndexOperations is bound to.- Specified by:
createSettingsin interfaceReactiveIndexOperations- Returns:
- a settings document.
-
createSettings
Description copied from interface:ReactiveIndexOperationsCreates the index settings from the annotations on the given class- Specified by:
createSettingsin interfaceReactiveIndexOperations- Parameters:
clazz- the class to create the index settings from- Returns:
- a settings document.
-
getSettings
Description copied from interface:ReactiveIndexOperationsget the settings for the index- Specified by:
getSettingsin interfaceReactiveIndexOperations- Parameters:
includeDefaults- whether or not to include all the default settings- Returns:
- a
Monowith aDocumentcontaining the index settings
-
alias
Description copied from interface:ReactiveIndexOperationsExecutes the givenAliasActions.- Specified by:
aliasin interfaceReactiveIndexOperations- Parameters:
aliasActions- the actions to execute- Returns:
- if the operation is acknowledged by Elasticsearch
-
getAliases
Description copied from interface:ReactiveIndexOperationsgets information about aliases- Specified by:
getAliasesin interfaceReactiveIndexOperations- Parameters:
aliasNames- alias names, must not be null- Returns:
- a
MonoofMapfrom index names toAliasDatafor that index
-
getAliasesForIndex
Description copied from interface:ReactiveIndexOperationsgets information about aliases- Specified by:
getAliasesForIndexin interfaceReactiveIndexOperations- Parameters:
indexNames- alias names, must not be null- Returns:
- a
MonoofMapfrom index names toAliasDatafor that index
-
putTemplate
Description copied from interface:ReactiveIndexOperationsCreates an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
putTemplatein interfaceReactiveIndexOperations- Parameters:
putTemplateRequest- template request parameters- Returns:
- Mono of true if the template could be stored
-
putComponentTemplate
Description copied from interface:ReactiveIndexOperationsWrites a component index template that can be used in a composable index template.- Specified by:
putComponentTemplatein interfaceReactiveIndexOperations- Parameters:
putComponentTemplateRequest- index template request parameters- Returns:
- true if successful
-
getComponentTemplate
public Flux<TemplateResponse> getComponentTemplate(GetComponentTemplateRequest getComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsGet component template(s).- Specified by:
getComponentTemplatein interfaceReactiveIndexOperations- Parameters:
getComponentTemplateRequest- the getComponentTemplateRequest parameters- Returns:
- a
FluxofTemplateResponse
-
existsComponentTemplate
public Mono<Boolean> existsComponentTemplate(ExistsComponentTemplateRequest existsComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsChecks wether a component index template exists.- Specified by:
existsComponentTemplatein interfaceReactiveIndexOperations- Parameters:
existsComponentTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the componentTemplate exists.
-
deleteComponentTemplate
public Mono<Boolean> deleteComponentTemplate(DeleteComponentTemplateRequest deleteComponentTemplateRequest) Description copied from interface:ReactiveIndexOperationsDeletes a component index template.- Specified by:
deleteComponentTemplatein interfaceReactiveIndexOperations- Parameters:
deleteComponentTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
putIndexTemplate
Description copied from interface:ReactiveIndexOperationsCreates an index template.- Specified by:
putIndexTemplatein interfaceReactiveIndexOperations- Parameters:
putIndexTemplateRequest- template request parameters- Returns:
- true if successful
-
existsIndexTemplate
Description copied from interface:ReactiveIndexOperationsChecks if an index template exists.- Specified by:
existsIndexTemplatein interfaceReactiveIndexOperations- Parameters:
existsIndexTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the index template exists.
-
getIndexTemplate
Description copied from interface:ReactiveIndexOperationsGet index template(s).- Specified by:
getIndexTemplatein interfaceReactiveIndexOperations- Returns:
- a
FluxofTemplateResponse
-
deleteIndexTemplate
Description copied from interface:ReactiveIndexOperationsDeletes an index template.- Specified by:
deleteIndexTemplatein interfaceReactiveIndexOperations- Parameters:
deleteIndexTemplateRequest- the parameters for the request- Returns:
- Mono with the value if the request was acknowledged.
-
getTemplate
Description copied from interface:ReactiveIndexOperationsgets an index template using the legacy Elasticsearch interface.- Specified by:
getTemplatein interfaceReactiveIndexOperations- Parameters:
getTemplateRequest- the request parameters- Returns:
- Mono of TemplateData, Mono.empty() if no template with the given name exists.
-
existsTemplate
Description copied from interface:ReactiveIndexOperationsChecks 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:
existsTemplatein interfaceReactiveIndexOperations- Parameters:
existsTemplateRequest- template request parameters- Returns:
- Mono of true if the template exists
-
deleteTemplate
Description copied from interface:ReactiveIndexOperationsDeletes an index template using the legacy Elasticsearch interface (@see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)- Specified by:
deleteTemplatein interfaceReactiveIndexOperations- Parameters:
deleteTemplateRequest- template request parameters- Returns:
- Mono of true if the template could be deleted
-
getInformation
Description copied from interface:ReactiveIndexOperationsGets theIndexInformationfor the indices defined byReactiveIndexOperations.getIndexCoordinates().- Specified by:
getInformationin interfaceReactiveIndexOperations- Returns:
- a flux of
IndexInformation
-
getIndexCoordinates
Description copied from interface:ReactiveIndexOperationsget 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:
getIndexCoordinatesin interfaceReactiveIndexOperations- Returns:
- IndexCoordinates
-