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 Details

    • count

      default reactor.core.publisher.Mono<Long> count(Class<?> entityType)
      Count the number of documents matching the given Query.
      Parameters:
      entityType - must not be null.
      Returns:
      a Mono emitting the nr of matching documents.
    • count

      reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityType)
      Count the number of documents matching the given Query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      Returns:
      a Mono emitting the nr of matching documents.
    • count

      reactor.core.publisher.Mono<Long> count(Query query, Class<?> entityType, IndexCoordinates index)
      Count the number of documents matching the given Query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      index - the target index, must not be null
      Returns:
      a Mono emitting the nr of matching documents.
    • search

      default <T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<T> entityType)
      Search the index for entities matching the given query.
      Unpaged queries 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 - must not be null.
      Returns:
      a Flux emitting matching entities one by one wrapped in a SearchHit.
    • search

      <T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<?> entityType, Class<T> returnType)
      Search the index for entities matching the given query.
      Unpaged queries 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 Flux emitting matching entities one by one wrapped in a SearchHit.
    • search

      default <T> reactor.core.publisher.Flux<SearchHit<T>> search(Query query, Class<T> entityType, IndexCoordinates index)
      Search the index for entities matching the given query.
      Type Parameters:
      T -
      Parameters:
      query - must not be null.
      entityType - must not be null.
      index - the target index, must not be null
      Returns:
      a Flux emitting matching entities one by one wrapped in a SearchHit.
    • 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 given query.
      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 Flux emitting matching entities one by one wrapped in a SearchHit.
    • searchForPage

      default <T> reactor.core.publisher.Mono<SearchPage<T>> searchForPage(Query query, Class<T> entityType)
      Search the index for entities matching the given query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      Returns:
      a Mono emitting matching entities in a SearchHits.
      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 given query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      resultType - the projection result type.
      Returns:
      a Mono emitting matching entities in a SearchHits.
      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 given query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      index - the target index, must not be null
      Returns:
      a Mono emitting matching entities in a SearchHits.
      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 given query.
      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 Mono emitting matching entities in a SearchHits.
      Since:
      4.1
    • searchForHits

      default <T> reactor.core.publisher.Mono<ReactiveSearchHits<T>> searchForHits(Query query, Class<T> entityType)
      Perform a search and return the ReactiveSearchHits which contains information about the search results and which will provide the documents by the ReactiveSearchHits.getSearchHits() method.
      Type Parameters:
      T - the result type class
      Parameters:
      query - must not be null.
      entityType - must not be null.
      Returns:
      a Mono emitting the ReactiveSearchHits that 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 the ReactiveSearchHits which contains information about the search results and which will provide the documents by the ReactiveSearchHits.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 Mono emitting the ReactiveSearchHits that 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 the ReactiveSearchHits which contains information about the search results and which will provide the documents by the ReactiveSearchHits.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 Mono emitting the ReactiveSearchHits that 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 the ReactiveSearchHits which contains information about the search results and which will provide the documents by the ReactiveSearchHits.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 Mono emitting the ReactiveSearchHits that contains the search result information
      Since:
      4.4
    • aggregate

      reactor.core.publisher.Flux<? extends AggregationContainer<?>> aggregate(Query query, Class<?> entityType)
      Perform an aggregation specified by the given query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      Returns:
      a Flux emitting matching aggregations one by one.
      Since:
      4.0
    • aggregate

      reactor.core.publisher.Flux<? extends AggregationContainer<?>> aggregate(Query query, Class<?> entityType, IndexCoordinates index)
      Perform an aggregation specified by the given query.
      Parameters:
      query - must not be null.
      entityType - must not be null.
      index - the target index, must not be null
      Returns:
      a Flux emitting 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, use suggest(Query, Class)
      Does a suggest query
      Parameters:
      suggestion - the query
      entityType - 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.
      Does a suggest query
      Parameters:
      suggestion - the query
      index - the index to run the query against
      Returns:
      the suggest response (Elasticsearch library classes)
    • suggest

      reactor.core.publisher.Mono<Suggest> suggest(Query query, Class<?> entityType)
      Does a suggest query.
      Parameters:
      query - the Query containing the suggest definition. Must be currently a NativeSearchQuery, 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 a NativeSearchQuery, 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 a Query to 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

      Query idsQuery(List<String> ids)
      Creates a Query to 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