public interface ReactiveElasticsearchOperations
Implemented by ReactiveElasticsearchTemplate
. Not often used but a useful option for extensibility and
testability (as it can be easily mocked, stubbed, or be the target of a JDK proxy). Command execution using
ReactiveElasticsearchOperations
is deferred until a Subscriber
subscribes to the
Publisher
.
Modifier and Type | Interface and Description |
---|---|
static interface |
ReactiveElasticsearchOperations.ClientCallback<T extends org.reactivestreams.Publisher<?>>
Callback interface to be used with
execute(ClientCallback) for operating directly on
ReactiveElasticsearchClient . |
Modifier and Type | Method and Description |
---|---|
default reactor.core.publisher.Mono<Long> |
count(Class<?> entityType)
Count the number of documents matching the given
Query . |
default reactor.core.publisher.Mono<Long> |
count(Query query,
Class<?> entityType)
Count the number of documents matching the given
Query . |
default reactor.core.publisher.Mono<Long> |
count(Query query,
Class<?> entityType,
String index)
Count the number of documents matching the given
Query . |
reactor.core.publisher.Mono<Long> |
count(Query query,
Class<?> entityType,
String index,
String type)
Count the number of documents matching the given
Query . |
default reactor.core.publisher.Mono<String> |
delete(Object entity)
Delete the given entity extracting index and type from entity metadata.
|
default reactor.core.publisher.Mono<String> |
delete(Object entity,
String index)
Delete the given entity extracting index and type from entity metadata.
|
reactor.core.publisher.Mono<String> |
delete(Object entity,
String index,
String type)
Delete the given entity extracting index and type from entity metadata.
|
default reactor.core.publisher.Mono<Long> |
deleteBy(Query query,
Class<?> entityType)
Delete the documents matching the given
Query extracting index and type from entity metadata. |
default reactor.core.publisher.Mono<Long> |
deleteBy(Query query,
Class<?> entityType,
String index)
Delete the documents matching the given
Query extracting index and type from entity metadata. |
reactor.core.publisher.Mono<Long> |
deleteBy(Query query,
Class<?> entityType,
String index,
String type)
Delete the documents matching the given
Query extracting index and type from entity metadata. |
default reactor.core.publisher.Mono<String> |
deleteById(String id,
Class<?> entityType)
Delete the entity with given id extracting index and type from entity metadata.
|
default reactor.core.publisher.Mono<String> |
deleteById(String id,
Class<?> entityType,
String index)
Delete the entity with given id extracting index and type from entity metadata.
|
reactor.core.publisher.Mono<String> |
deleteById(String id,
Class<?> entityType,
String index,
String type)
Delete the entity with given id extracting index and type from entity metadata.
|
default reactor.core.publisher.Mono<String> |
deleteById(String id,
String index,
String type)
Delete the entity with given id.
|
<T> org.reactivestreams.Publisher<T> |
execute(ReactiveElasticsearchOperations.ClientCallback<org.reactivestreams.Publisher<T>> callback)
Execute within a
ReactiveElasticsearchOperations.ClientCallback managing resources and translating errors. |
default reactor.core.publisher.Mono<Boolean> |
exists(String id,
Class<?> entityType)
Check if an entity with given id exists.
|
default reactor.core.publisher.Mono<Boolean> |
exists(String id,
Class<?> entityType,
String index)
Check if an entity with given id exists.
|
reactor.core.publisher.Mono<Boolean> |
exists(String id,
Class<?> entityType,
String index,
String type)
Check if an entity with given id exists.
|
default <T> reactor.core.publisher.Flux<T> |
find(Query query,
Class<?> entityType,
Class<T> returnType)
Search the index for entities matching the given
query . |
<T> reactor.core.publisher.Flux<T> |
find(Query query,
Class<?> entityType,
String index,
String type,
Class<T> resultType)
Search the index for entities matching the given
query . |
default <T> reactor.core.publisher.Flux<T> |
find(Query query,
Class<T> entityType)
Search the index for entities matching the given
query . |
default <T> reactor.core.publisher.Flux<T> |
find(Query query,
Class<T> entityType,
String index)
Search the index for entities matching the given
query . |
default <T> reactor.core.publisher.Flux<T> |
find(Query query,
Class<T> entityType,
String index,
String type)
Search the index for entities matching the given
query . |
default <T> reactor.core.publisher.Mono<T> |
findById(String id,
Class<T> entityType)
Find the document with the given id mapped onto the given entityType.
|
default <T> reactor.core.publisher.Mono<T> |
findById(String id,
Class<T> entityType,
String index)
Fetch the entity with given id.
|
<T> reactor.core.publisher.Mono<T> |
findById(String id,
Class<T> entityType,
String index,
String type)
Fetch the entity with given id.
|
ElasticsearchConverter |
getElasticsearchConverter()
Get the
ElasticsearchConverter used. |
default <T> reactor.core.publisher.Mono<T> |
save(reactor.core.publisher.Mono<? extends T> entityPublisher)
Index the given entity, once available, extracting index and type from entity metadata.
|
default <T> reactor.core.publisher.Mono<T> |
save(reactor.core.publisher.Mono<? extends T> entityPublisher,
String index)
Index the entity, once available, in the given index.
|
default <T> reactor.core.publisher.Mono<T> |
save(reactor.core.publisher.Mono<? extends T> entityPublisher,
String index,
String type)
Index the entity, once available, under the given type in the given index.
|
default <T> reactor.core.publisher.Mono<T> |
save(T entity)
Index the given entity extracting index and type from entity metadata.
|
default <T> reactor.core.publisher.Mono<T> |
save(T entity,
String index)
Index the entity in the given index.
|
<T> reactor.core.publisher.Mono<T> |
save(T entity,
String index,
String type)
Index the entity under the given type in the given index.
|
<T> org.reactivestreams.Publisher<T> execute(ReactiveElasticsearchOperations.ClientCallback<org.reactivestreams.Publisher<T>> callback)
ReactiveElasticsearchOperations.ClientCallback
managing resources and translating errors.T
- callback
- must not be null.Publisher
emitting results.default <T> reactor.core.publisher.Mono<T> save(reactor.core.publisher.Mono<? extends T> entityPublisher)
T
- entityPublisher
- must not be null.Mono
emitting the saved entity.default <T> reactor.core.publisher.Mono<T> save(T entity)
T
- entity
- must not be null.Mono
emitting the saved entity.default <T> reactor.core.publisher.Mono<T> save(reactor.core.publisher.Mono<? extends T> entityPublisher, String index)
T
- entityPublisher
- must not be null.index
- the name of the target index. Can be null.Mono
emitting the saved entity.default <T> reactor.core.publisher.Mono<T> save(T entity, @Nullable String index)
T
- entity
- must not be null.index
- the name of the target index. Can be null.Mono
emitting the saved entity.default <T> reactor.core.publisher.Mono<T> save(reactor.core.publisher.Mono<? extends T> entityPublisher, @Nullable String index, @Nullable String type)
T
- entityPublisher
- must not be null.index
- the name of the target index. Can be null.type
- the name of the type within the index. Can be null.Mono
emitting the saved entity.<T> reactor.core.publisher.Mono<T> save(T entity, @Nullable String index, @Nullable String type)
T
- entity
- must not be null.index
- the name of the target index. Can be null.type
- the name of the type within the index. Can be null.Mono
emitting the saved entity.default <T> reactor.core.publisher.Mono<T> findById(String id, Class<T> entityType)
T
- id
- the _id of the document to fetch.entityType
- the domain type used for mapping the document.Mono.empty()
if not found.default <T> reactor.core.publisher.Mono<T> findById(String id, Class<T> entityType, @Nullable String index)
T
- id
- the _id of the document to fetch.entityType
- the domain type used for mapping the document.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono.empty()
if not found.<T> reactor.core.publisher.Mono<T> findById(String id, Class<T> entityType, @Nullable String index, @Nullable String type)
T
- id
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting the entity or signalling completion if none found.default reactor.core.publisher.Mono<Boolean> exists(String id, Class<?> entityType)
id
- the _id of the document to look for.entityType
- the domain type used.Mono
emitting true if a matching document exists, false otherwise.default reactor.core.publisher.Mono<Boolean> exists(String id, Class<?> entityType, @Nullable String index)
id
- the _id of the document to look for.entityType
- the domain type used.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono
emitting true if a matching document exists, false otherwise.reactor.core.publisher.Mono<Boolean> exists(String id, Class<?> entityType, @Nullable String index, @Nullable String type)
id
- the _id of the document to look for.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting true if a matching document exists, false otherwise.default <T> reactor.core.publisher.Flux<T> find(Query query, Class<T> entityType)
query
. Unpaged
queries may overrule elasticsearch server defaults for page size by either
delegating to the scroll API or using a max size
.T
- query
- must not be null.entityType
- must not be null.Flux
emitting matching entities one by one.default <T> reactor.core.publisher.Flux<T> find(Query query, Class<?> entityType, Class<T> returnType)
query
. Unpaged
queries may overrule elasticsearch server defaults for page size by either *
delegating to the scroll API or using a max *
size
.T
- query
- must not be null.entityType
- The entity type for mapping the query. Must not be null.returnType
- The mapping target type. Must not be null. ThFlux
emitting matching entities one by one.default <T> reactor.core.publisher.Flux<T> find(Query query, Class<T> entityType, @Nullable String index)
query
.T
- query
- must not be null.entityType
- must not be null.Flux
emitting matching entities one by one.default <T> reactor.core.publisher.Flux<T> find(Query query, Class<T> entityType, @Nullable String index, @Nullable String type)
query
.T
- query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.<T> reactor.core.publisher.Flux<T> find(Query query, Class<?> entityType, @Nullable String index, @Nullable String type, Class<T> resultType)
query
.T
- query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.resultType
- the projection result type.Flux
emitting matching entities one by one.default reactor.core.publisher.Mono<Long> count(Class<?> entityType)
Query
.entityType
- must not be null.Mono
emitting the nr of matching documents.default reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityType)
Query
.query
- must not be null.entityType
- must not be null.Mono
emitting the nr of matching documents.default reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityType, @Nullable String index)
Query
.query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono
emitting the nr of matching documents.reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityType, @Nullable String index, @Nullable String type)
Query
.query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting the nr of matching documents.default reactor.core.publisher.Mono<String> delete(Object entity)
entity
- must not be null.Mono
emitting the id of the removed document.default reactor.core.publisher.Mono<String> delete(Object entity, @Nullable String index)
entity
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono
emitting the id of the removed document.reactor.core.publisher.Mono<String> delete(Object entity, @Nullable String index, @Nullable String type)
entity
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting the id of the removed document.default reactor.core.publisher.Mono<String> deleteById(String id, String index, String type)
id
- must not be null.index
- the name of the target index.type
- the name of the target type.Mono
emitting the id of the removed document.default reactor.core.publisher.Mono<String> deleteById(String id, Class<?> entityType)
id
- must not be null.entityType
- must not be null.Mono
emitting the id of the removed document.default reactor.core.publisher.Mono<String> deleteById(String id, Class<?> entityType, @Nullable String index)
id
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono
emitting the id of the removed document.reactor.core.publisher.Mono<String> deleteById(String id, Class<?> entityType, @Nullable String index, @Nullable String type)
id
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting the id of the removed document.default reactor.core.publisher.Mono<Long> deleteBy(Query query, Class<?> entityType)
Query
extracting index and type from entity metadata.query
- must not be null.entityType
- must not be null.Mono
emitting the number of the removed documents.default reactor.core.publisher.Mono<Long> deleteBy(Query query, Class<?> entityType, @Nullable String index)
Query
extracting index and type from entity metadata.query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.Mono
emitting the number of the removed documents.reactor.core.publisher.Mono<Long> deleteBy(Query query, Class<?> entityType, @Nullable String index, @Nullable String type)
Query
extracting index and type from entity metadata.query
- must not be null.entityType
- must not be null.index
- the name of the target index. Overwrites document metadata from entityType if not
null.type
- the name of the target type. Overwrites document metadata from entityType if not
null.Mono
emitting the number of the removed documents.ElasticsearchConverter getElasticsearchConverter()
ElasticsearchConverter
used.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.