Interface ReactiveSearchOperations
- All Known Subinterfaces:
ReactiveElasticsearchOperations
- All Known Implementing Classes:
AbstractReactiveElasticsearchTemplate,ReactiveElasticsearchTemplate,ReactiveElasticsearchTemplate
public interface ReactiveSearchOperations
The reactive operations for the
Elasticsearch Document
APIs.
- Since:
- 4.0
- Author:
- Peter-Josef Meisch, Russell Parry, Thomas Geese
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<AggregationContainer<?>>Perform an aggregation specified by the givenquery.reactor.core.publisher.Flux<AggregationContainer<?>>aggregate(Query query, Class<?> entityType, IndexCoordinates index) Perform an aggregation specified by the givenquery.default reactor.core.publisher.Mono<Long>Count the number of documents matching the givenQuery.reactor.core.publisher.Mono<Long>Count the number of documents matching the givenQuery.reactor.core.publisher.Mono<Long>count(Query query, Class<?> entityType, IndexCoordinates index) Count the number of documents matching the givenQuery.Creates aQueryto find get all documents with given ids.Creates aQueryto find all documents.<T> reactor.core.publisher.Flux<SearchHit<T>>Search the index for entities matching the givenquery.<T> reactor.core.publisher.Flux<SearchHit<T>>search(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Search the index for entities matching the givenquery.default <T> reactor.core.publisher.Flux<SearchHit<T>>Search the index for entities matching the givenquery.default <T> reactor.core.publisher.Flux<SearchHit<T>>search(Query query, Class<T> entityType, IndexCoordinates index) Search the index for entities matching the givenquery.<T> reactor.core.publisher.Mono<ReactiveSearchHits<T>>searchForHits(Query query, Class<?> entityType, Class<T> resultType) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.<T> reactor.core.publisher.Mono<ReactiveSearchHits<T>>searchForHits(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.default <T> reactor.core.publisher.Mono<ReactiveSearchHits<T>>searchForHits(Query query, Class<T> entityType) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.default <T> reactor.core.publisher.Mono<ReactiveSearchHits<T>>searchForHits(Query query, Class<T> entityType, IndexCoordinates index) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.<T> reactor.core.publisher.Mono<SearchPage<T>>searchForPage(Query query, Class<?> entityType, Class<T> resultType) Search the index for entities matching the givenquery.<T> reactor.core.publisher.Mono<SearchPage<T>>searchForPage(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Search the index for entities matching the givenquery.default <T> reactor.core.publisher.Mono<SearchPage<T>>searchForPage(Query query, Class<T> entityType) Search the index for entities matching the givenquery.default <T> reactor.core.publisher.Mono<SearchPage<T>>searchForPage(Query query, Class<T> entityType, IndexCoordinates index) Search the index for entities matching the givenquery.reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest>Deprecated.reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest>suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, IndexCoordinates index) Deprecated.since 4.3, usesuggest(Query, Class, IndexCoordinates)reactor.core.publisher.Mono<Suggest>Does a suggest query.reactor.core.publisher.Mono<Suggest>suggest(Query query, Class<?> entityType, IndexCoordinates index) Does a suggest query.
-
Method Details
-
count
Count the number of documents matching the givenQuery.- Parameters:
entityType- must not be null.- Returns:
- a
Monoemitting the nr of matching documents.
-
count
Count the number of documents matching the givenQuery.- Parameters:
query- must not be null.entityType- must not be null.- Returns:
- a
Monoemitting the nr of matching documents.
-
count
Count the number of documents matching the givenQuery.- Parameters:
query- must not be null.entityType- must not be null.index- the target index, must not be null- Returns:
- a
Monoemitting the nr of matching documents.
-
search
Search the index for entities matching the givenquery.
Unpagedqueries may overrule elasticsearch server defaults for page size by either delegating to the scroll API or using a maxsize.- Type Parameters:
T-- Parameters:
query- must not be null.entityType- must not be null.- Returns:
- a
Fluxemitting matching entities one by one wrapped in aSearchHit.
-
search
<T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<?> entityType, Class<T> returnType) Search the index for entities matching the givenquery.
Unpagedqueries may overrule elasticsearch server defaults for page size by either * delegating to the scroll API or using a max* size.- Type Parameters:
T-- Parameters:
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. Th- Returns:
- a
Fluxemitting matching entities one by one wrapped in aSearchHit.
-
search
default <T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<T> entityType, IndexCoordinates index) Search the index for entities matching the givenquery.- Type Parameters:
T-- Parameters:
query- must not be null.entityType- must not be null.index- the target index, must not be null- Returns:
- a
Fluxemitting matching entities one by one wrapped in aSearchHit.
-
search
<T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Search the index for entities matching the givenquery.- Type Parameters:
T-- Parameters:
query- must not be null.entityType- must not be null.resultType- the projection result type.index- the target index, must not be null- Returns:
- a
Fluxemitting matching entities one by one wrapped in aSearchHit.
-
searchForPage
default <T> reactor.core.publisher.Mono<SearchPage<T>> searchForPage(Query query, Class<T> entityType) Search the index for entities matching the givenquery.- Parameters:
query- must not be null.entityType- must not be null.- Returns:
- a
Monoemitting matching entities in aSearchHits. - Since:
- 4.1
-
searchForPage
<T> reactor.core.publisher.Mono<SearchPage<T>> searchForPage(Query query, Class<?> entityType, Class<T> resultType) Search the index for entities matching the givenquery.- Parameters:
query- must not be null.entityType- must not be null.resultType- the projection result type.- Returns:
- a
Monoemitting matching entities in aSearchHits. - Since:
- 4.1
-
searchForPage
default <T> reactor.core.publisher.Mono<SearchPage<T>> searchForPage(Query query, Class<T> entityType, IndexCoordinates index) Search the index for entities matching the givenquery.- Parameters:
query- must not be null.entityType- must not be null.index- the target index, must not be null- Returns:
- a
Monoemitting matching entities in aSearchHits. - Since:
- 4.1
-
searchForPage
<T> reactor.core.publisher.Mono<SearchPage<T>> searchForPage(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Search the index for entities matching the givenquery.- Parameters:
query- must not be null.entityType- must not be null.resultType- the projection result type.index- the target index, must not be null- Returns:
- a
Monoemitting matching entities in aSearchHits. - Since:
- 4.1
-
searchForHits
default <T> reactor.core.publisher.Mono<ReactiveSearchHits<T>> searchForHits(Query query, Class<T> entityType) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.- Type Parameters:
T- the result type class- Parameters:
query- must not be null.entityType- must not be null.- Returns:
- a
Monoemitting theReactiveSearchHitsthat contains the search result information - Since:
- 4.4
-
searchForHits
<T> reactor.core.publisher.Mono<ReactiveSearchHits<T>> searchForHits(Query query, Class<?> entityType, Class<T> resultType) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.- Type Parameters:
T- the result type class- Parameters:
query- must not be null.entityType- must not be null.resultType- the projection result type.- Returns:
- a
Monoemitting theReactiveSearchHitsthat contains the search result information - Since:
- 4.4
-
searchForHits
default <T> reactor.core.publisher.Mono<ReactiveSearchHits<T>> searchForHits(Query query, Class<T> entityType, IndexCoordinates index) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.- Type Parameters:
T- the result type class- Parameters:
query- must not be null.entityType- must not be null.index- the target index, must not be null- Returns:
- a
Monoemitting theReactiveSearchHitsthat contains the search result information - Since:
- 4.4
-
searchForHits
<T> reactor.core.publisher.Mono<ReactiveSearchHits<T>> searchForHits(Query query, Class<?> entityType, Class<T> resultType, IndexCoordinates index) Perform a search and return theReactiveSearchHitswhich contains information about the search results and which will provide the documents by theReactiveSearchHits.getSearchHits()method.- Type Parameters:
T- the result type class- Parameters:
query- must not be null.entityType- must not be null.resultType- the projection result type.index- the target index, must not be null- Returns:
- a
Monoemitting theReactiveSearchHitsthat contains the search result information - Since:
- 4.4
-
aggregate
Perform an aggregation specified by the givenquery.- Parameters:
query- must not be null.entityType- must not be null.- Returns:
- a
Fluxemitting matching aggregations one by one. - Since:
- 4.0
-
aggregate
reactor.core.publisher.Flux<AggregationContainer<?>> aggregate(Query query, Class<?> entityType, IndexCoordinates index) Perform an aggregation specified by the givenquery.- Parameters:
query- must not be null.entityType- must not be null.index- the target index, must not be null- Returns:
- a
Fluxemitting matching aggregations one by one. - Since:
- 4.0
-
suggest
@Deprecated reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, Class<?> entityType) Deprecated.since 4.3, usesuggest(Query, Class)Does a suggest query- Parameters:
suggestion- the queryentityType- must not be null.- Returns:
- the suggest response (Elasticsearch library classes)
-
suggest
@Deprecated reactor.core.publisher.Flux<org.elasticsearch.search.suggest.Suggest> suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, IndexCoordinates index) Deprecated.since 4.3, usesuggest(Query, Class, IndexCoordinates)Does a suggest query- Parameters:
suggestion- the queryindex- the index to run the query against- Returns:
- the suggest response (Elasticsearch library classes)
-
suggest
Does a suggest query.- Parameters:
query- the Query containing the suggest definition. Must be currently aNativeSearchQuery, must not be null.entityType- the type of the entities that might be returned for a completion suggestion, must not be null.- Returns:
- suggest data
- Since:
- 4.3
-
suggest
reactor.core.publisher.Mono<Suggest> suggest(Query query, Class<?> entityType, IndexCoordinates index) Does a suggest query.- Parameters:
query- the Query containing the suggest definition. Must be currently aNativeSearchQuery, must not be null.entityType- the type of the entities that might be returned for a completion suggestion, must not be null.index- the index to run the query against, must not be null.- Returns:
- suggest data
- Since:
- 4.3
-
matchAllQuery
Query matchAllQuery()Creates aQueryto find all documents. Must be implemented by the concrete implementations to provide an appropriate query using the respective client.- Returns:
- a query to find all documents
- Since:
- 4.3
-
idsQuery
Creates aQueryto find get all documents with given ids. Must be implemented by the concrete implementations to provide an appropriate query using the respective client.- Parameters:
ids- the list of ids must not be null- Returns:
- query returning the documents with the given ids
- Since:
- 4.3
-
suggest(Query, Class)