Interface ReactiveSearchOperations

All Known Subinterfaces:
ReactiveElasticsearchOperations
All Known Implementing Classes:
AbstractReactiveElasticsearchTemplate, 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.
      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.
      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

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

      default reactor.core.publisher.Mono<String> openPointInTime(IndexCoordinates index, Duration keepAlive)
      Opens a point in time (pit) in Elasticsearch.
      Parameters:
      index - the index name(s) to use
      keepAlive - the duration the pit shoult be kept alive
      Returns:
      the pit identifier
      Since:
      5.0
    • openPointInTime

      reactor.core.publisher.Mono<String> openPointInTime(IndexCoordinates index, Duration keepAlive, Boolean ignoreUnavailable)
      Opens a point in time (pit) in Elasticsearch.
      Parameters:
      index - the index name(s) to use
      keepAlive - the duration the pit shoult be kept alive
      ignoreUnavailable - if {$literal true} the call will fail if any of the indices is missing or closed
      Returns:
      the pit identifier
      Since:
      5.0
    • closePointInTime

      reactor.core.publisher.Mono<Boolean> closePointInTime(String pit)
      Closes a point in time
      Parameters:
      pit - the pit identifier as returned by openPointInTime(IndexCoordinates, Duration, Boolean)
      Returns:
      true on success
      Since:
      5.0
    • 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
    • queryBuilderWithIds

      BaseQueryBuilder queryBuilderWithIds(List<String> ids)
      Creates a BaseQueryBuilder that has the given ids setto the parameter value. No other properties of the bulder are set.
      Parameters:
      ids - the list of ids must not be null
      Returns:
      query returning the documents with the given ids
      Since:
      5.2