public class ReactiveElasticsearchTemplate extends AbstractReactiveElasticsearchTemplate
ReactiveElasticsearchOperations using the new
Elasticsearch client.AbstractReactiveElasticsearchTemplate.DocumentCallback<T>, AbstractReactiveElasticsearchTemplate.Entities<T>, AbstractReactiveElasticsearchTemplate.IndexResponseMetaData, AbstractReactiveElasticsearchTemplate.ReadDocumentCallback<T>, AbstractReactiveElasticsearchTemplate.ReadSearchDocumentCallback<T>, AbstractReactiveElasticsearchTemplate.SearchDocumentCallback<T>ReactiveElasticsearchOperations.ClusterClientCallback<T extends org.reactivestreams.Publisher<?>>, ReactiveElasticsearchOperations.IndicesClientCallback<T extends org.reactivestreams.Publisher<?>>converter, entityCallbacks, entityOperations, mappingContext, QUERY_LOGGER, refreshPolicy, routingResolver| Modifier | Constructor and Description |
|---|---|
protected |
ReactiveElasticsearchTemplate(ReactiveElasticsearchClient client,
ElasticsearchConverter converter) |
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Flux<? extends AggregationContainer<?>> |
aggregate(Query query,
Class<?> entityType,
IndexCoordinates index)
Perform an aggregation specified by the given
query. |
reactor.core.publisher.Mono<Void> |
bulkUpdate(List<UpdateQuery> queries,
BulkOptions bulkOptions,
IndexCoordinates index)
Bulk update all objects.
|
ReactiveClusterOperations |
cluster()
return a
ReactiveClusterOperations instance that uses the same client communication setup as this
ElasticsearchOperations instance. |
reactor.core.publisher.Mono<ByQueryResponse> |
delete(Query query,
Class<?> entityType,
IndexCoordinates index)
Delete the documents matching the given
Query extracting index from entity metadata. |
protected ReactiveElasticsearchTemplate |
doCopy() |
protected reactor.core.publisher.Mono<Long> |
doCount(Query query,
Class<?> entityType,
IndexCoordinates index) |
protected reactor.core.publisher.Mono<String> |
doDeleteById(String id,
String routing,
IndexCoordinates index) |
protected reactor.core.publisher.Mono<Boolean> |
doExists(String id,
IndexCoordinates index) |
protected reactor.core.publisher.Flux<SearchDocument> |
doFind(Query query,
Class<?> clazz,
IndexCoordinates index) |
protected <T> reactor.core.publisher.Mono<SearchDocumentResponse> |
doFindForResponse(Query query,
Class<?> clazz,
IndexCoordinates index) |
protected <T> reactor.core.publisher.Mono<reactor.util.function.Tuple2<T,AbstractReactiveElasticsearchTemplate.IndexResponseMetaData>> |
doIndex(T entity,
IndexCoordinates index) |
<T> org.reactivestreams.Publisher<T> |
execute(ReactiveElasticsearchOperations.ClientCallback<org.reactivestreams.Publisher<T>> callback)
Deprecated.
|
<T> org.reactivestreams.Publisher<T> |
execute(org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchTemplate.ClientCallback<org.reactivestreams.Publisher<T>> callback)
Execute a callback with the
ReactiveElasticsearchClient and provide exception translation. |
<T> org.reactivestreams.Publisher<T> |
executeWithClusterClient(ReactiveElasticsearchOperations.ClusterClientCallback<org.reactivestreams.Publisher<T>> callback)
Execute within a
ReactiveElasticsearchOperations.ClusterClientCallback managing resources and translating errors. |
<T> org.reactivestreams.Publisher<T> |
executeWithIndicesClient(ReactiveElasticsearchOperations.IndicesClientCallback<org.reactivestreams.Publisher<T>> callback)
Execute within a
ReactiveElasticsearchOperations.IndicesClientCallback managing resources and translating errors. |
<T> reactor.core.publisher.Mono<T> |
get(String id,
Class<T> entityType,
IndexCoordinates index)
Fetch the entity with given id.
|
protected reactor.core.publisher.Mono<String> |
getClusterVersion() |
protected reactor.core.publisher.Mono<String> |
getRuntimeLibraryVersion() |
protected reactor.core.publisher.Mono<String> |
getVendor() |
Query |
idsQuery(List<String> ids)
Creates a
Query to find get all documents with given ids. |
ReactiveIndexOperations |
indexOps(Class<?> clazz)
Creates a
ReactiveIndexOperations that is bound to the given class |
ReactiveIndexOperations |
indexOps(IndexCoordinates index)
Creates a
ReactiveIndexOperations that is bound to the given index |
Query |
matchAllQuery()
Creates a
Query to find all documents. |
<T> reactor.core.publisher.Flux<MultiGetItem<T>> |
multiGet(Query query,
Class<T> clazz,
IndexCoordinates index)
Execute a multiGet against elasticsearch for the given ids.
|
reactor.core.publisher.Mono<ReindexResponse> |
reindex(ReindexRequest reindexRequest)
Copies documents from a source to a destination.
|
<T> reactor.core.publisher.Flux<T> |
saveAll(reactor.core.publisher.Mono<? extends Collection<? extends T>> entitiesPublisher,
IndexCoordinates index)
Index entities in the given index.
|
reactor.core.publisher.Mono<String> |
submitReindex(ReindexRequest reindexRequest)
Submits a reindex task.
|
reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
Class<?> entityType)
Does a suggest query
|
reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
IndexCoordinates index)
Does a suggest query
|
reactor.core.publisher.Mono<UpdateResponse> |
update(UpdateQuery updateQuery,
IndexCoordinates index)
Partial update of the document.
|
reactor.core.publisher.Mono<ByQueryResponse> |
updateByQuery(UpdateQuery updateQuery,
IndexCoordinates index)
Update document(s) by query.
|
aggregate, count, count, delete, delete, delete, delete, delete, exists, exists, get, getElasticsearchConverter, getIndexCoordinatesFor, getIndexQuery, getPersistentEntityFor, getRefreshPolicy, logVersions, maybeCallAfterConvert, maybeCallAfterSave, maybeCallbackAfterLoad, maybeCallBeforeConvert, multiGet, save, save, saveAll, search, search, searchForHits, searchForHits, searchForPage, searchForPage, setApplicationContext, setEntityCallbacks, setRefreshPolicy, suggest, suggest, updateIndexedObject, withRoutingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbulkUpdate, save, save, saveAll, saveAllcount, search, search, searchForHits, searchForHits, searchForPage, searchForPageprotected ReactiveElasticsearchTemplate(ReactiveElasticsearchClient client, ElasticsearchConverter converter)
protected <T> reactor.core.publisher.Mono<reactor.util.function.Tuple2<T,AbstractReactiveElasticsearchTemplate.IndexResponseMetaData>> doIndex(T entity, IndexCoordinates index)
doIndex in class AbstractReactiveElasticsearchTemplatepublic <T> reactor.core.publisher.Flux<T> saveAll(reactor.core.publisher.Mono<? extends Collection<? extends T>> entitiesPublisher, IndexCoordinates index)
ReactiveDocumentOperationsentitiesPublisher - must not be null.index - the target index, must not be nullFlux emitting saved entities.public <T> reactor.core.publisher.Mono<T> get(String id, Class<T> entityType, IndexCoordinates index)
ReactiveDocumentOperationsid - must not be null.index - the target index, must not be nullMono emitting the entity or signalling completion if none found.public reactor.core.publisher.Mono<ReindexResponse> reindex(ReindexRequest reindexRequest)
ReactiveDocumentOperationsreindexRequest - reindex request parametersMono emitting the reindex responsepublic reactor.core.publisher.Mono<String> submitReindex(ReindexRequest reindexRequest)
ReactiveDocumentOperationsreindexRequest - reindex request parametersMono emitting the task id.public reactor.core.publisher.Mono<Void> bulkUpdate(List<UpdateQuery> queries, BulkOptions bulkOptions, IndexCoordinates index)
ReactiveDocumentOperationsqueries - the queries to execute in bulkbulkOptions - options to be added to the bulk requestprotected reactor.core.publisher.Mono<String> doDeleteById(String id, @Nullable String routing, IndexCoordinates index)
doDeleteById in class AbstractReactiveElasticsearchTemplatepublic <T> reactor.core.publisher.Flux<MultiGetItem<T>> multiGet(Query query, Class<T> clazz, IndexCoordinates index)
ReactiveDocumentOperationsquery - the query defining the ids of the objects to getclazz - the type of the object to be returnedindex - the index(es) from which the objects are read.MultiGetItems that contain the entitiesQuery.multiGetQuery(Collection),
Query.multiGetQueryWithRouting(List)protected ReactiveElasticsearchTemplate doCopy()
doCopy in class AbstractReactiveElasticsearchTemplateprotected reactor.core.publisher.Mono<Boolean> doExists(String id, IndexCoordinates index)
doExists in class AbstractReactiveElasticsearchTemplatepublic reactor.core.publisher.Mono<ByQueryResponse> delete(Query query, Class<?> entityType, IndexCoordinates index)
ReactiveDocumentOperationsQuery extracting index from entity metadata.query - must not be null.entityType - must not be null.index - the target index, must not be nullMono emitting the number of the removed documents.protected reactor.core.publisher.Flux<SearchDocument> doFind(Query query, Class<?> clazz, IndexCoordinates index)
doFind in class AbstractReactiveElasticsearchTemplateprotected reactor.core.publisher.Mono<Long> doCount(Query query, Class<?> entityType, IndexCoordinates index)
doCount in class AbstractReactiveElasticsearchTemplateprotected <T> reactor.core.publisher.Mono<SearchDocumentResponse> doFindForResponse(Query query, Class<?> clazz, IndexCoordinates index)
doFindForResponse in class AbstractReactiveElasticsearchTemplatepublic reactor.core.publisher.Flux<? extends AggregationContainer<?>> aggregate(Query query, Class<?> entityType, IndexCoordinates index)
ReactiveSearchOperationsquery. query - must not be null.entityType - must not be null.index - the target index, must not be nullFlux emitting matching aggregations one by one.protected reactor.core.publisher.Mono<String> getVendor()
getVendor in class AbstractReactiveElasticsearchTemplateprotected reactor.core.publisher.Mono<String> getRuntimeLibraryVersion()
getRuntimeLibraryVersion in class AbstractReactiveElasticsearchTemplateprotected reactor.core.publisher.Mono<String> getClusterVersion()
getClusterVersion in class AbstractReactiveElasticsearchTemplatepublic reactor.core.publisher.Mono<UpdateResponse> update(UpdateQuery updateQuery, IndexCoordinates index)
ReactiveDocumentOperationsupdateQuery - query defining the updateindex - the index where to update the recordsMono emitting the update responsepublic reactor.core.publisher.Mono<ByQueryResponse> updateByQuery(UpdateQuery updateQuery, IndexCoordinates index)
ReactiveDocumentOperationsupdateQuery - query defining the update, must not be nullindex - the index where to update the records, must not be nullMono emitting the update response@Deprecated public <T> org.reactivestreams.Publisher<T> execute(ReactiveElasticsearchOperations.ClientCallback<org.reactivestreams.Publisher<T>> callback)
ReactiveElasticsearchOperationsReactiveElasticsearchOperations.ClientCallback managing resources and translating errors.T - the type the Publisher emitscallback - must not be null.Publisher emitting results.public <T> org.reactivestreams.Publisher<T> executeWithIndicesClient(ReactiveElasticsearchOperations.IndicesClientCallback<org.reactivestreams.Publisher<T>> callback)
ReactiveElasticsearchOperationsReactiveElasticsearchOperations.IndicesClientCallback managing resources and translating errors.T - the type the Publisher emitscallback - must not be null.Publisher emitting results.public <T> org.reactivestreams.Publisher<T> executeWithClusterClient(ReactiveElasticsearchOperations.ClusterClientCallback<org.reactivestreams.Publisher<T>> callback)
ReactiveElasticsearchOperationsReactiveElasticsearchOperations.ClusterClientCallback managing resources and translating errors.T - the type the Publisher emitscallback - must not be null.Publisher emitting results.public ReactiveIndexOperations indexOps(IndexCoordinates index)
ReactiveElasticsearchOperationsReactiveIndexOperations that is bound to the given indexindex - IndexCoordinates specifying the indexpublic ReactiveIndexOperations indexOps(Class<?> clazz)
ReactiveElasticsearchOperationsReactiveIndexOperations that is bound to the given classclazz - the entity clazz specifiying the index informationpublic ReactiveClusterOperations cluster()
ReactiveElasticsearchOperationsReactiveClusterOperations instance that uses the same client communication setup as this
ElasticsearchOperations instance.public reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
Class<?> entityType)
ReactiveSearchOperationssuggestion - the queryentityType - must not be null.public reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
IndexCoordinates index)
ReactiveSearchOperationssuggestion - the queryindex - the index to run the query againstpublic Query matchAllQuery()
ReactiveSearchOperationsQuery to find all documents. Must be implemented by the concrete implementations to provide an
appropriate query using the respective client.public Query idsQuery(List<String> ids)
ReactiveSearchOperationsQuery to find get all documents with given ids. Must be implemented by the concrete
implementations to provide an appropriate query using the respective client.ids - the list of ids must not be nullpublic <T> org.reactivestreams.Publisher<T> execute(org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchTemplate.ClientCallback<org.reactivestreams.Publisher<T>> callback)
ReactiveElasticsearchClient and provide exception translation.T - the type returned from the callbackcallback - the callback to execute, must not be nullCopyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.