Interface SearchIndexSearching<T>

  • Type Parameters:
    T -
    All Superinterfaces:
    SearchIndexBase<T>
    All Known Implementing Classes:
    SearchIndex

    public interface SearchIndexSearching<T>
    extends SearchIndexBase<T>
    This interface holds all endpoints related to search.
    • Method Detail

      • search

        default SearchResult<T> search​(@Nonnull
                                       Query query)
        Method used for querying an index. The search query only allows for the retrieval of up to 1000 hits. If you need to retrieve more than 1000 hits (e.g. for SEO), you can either leverage the Browse index method or increase the paginationLimitedTo parameter.
        Parameters:
        query - The search query
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • search

        default SearchResult<T> search​(@Nonnull
                                       Query query,
                                       RequestOptions requestOptions)
        Method used for querying an index. The search query only allows for the retrieval of up to 1000 hits. If you need to retrieve more than 1000 hits (e.g. for SEO), you can either leverage the Browse index method or increase the paginationLimitedTo parameter.
        Parameters:
        query - The search query
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • searchAsync

        default CompletableFuture<SearchResult<T>> searchAsync​(@Nonnull
                                                               Query query)
        Method used for querying an index. The search query only allows for the retrieval of up to 1000 hits. If you need to retrieve more than 1000 hits (e.g. for SEO), you can either leverage the Browse index method or increase the paginationLimitedTo parameter.
        Parameters:
        query - The search query
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • searchAsync

        default CompletableFuture<SearchResult<T>> searchAsync​(@Nonnull
                                                               Query query,
                                                               RequestOptions requestOptions)
        Method used for querying an index. The search query only allows for the retrieval of up to 1000 hits. If you need to retrieve more than 1000 hits (e.g. for SEO), you can either leverage the Browse index method or increase the paginationLimitedTo parameter.
        Parameters:
        query - The search query
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • searchForFacetValues

        default SearchForFacetResponse searchForFacetValues​(@Nonnull
                                                            SearchForFacetRequest query)
        Search for a set of values within a given facet attribute. Can be combined with a query. This method enables you to search through the values of a facet attribute, selecting only a subset of those values that meet a given criteria.
        Parameters:
        query - Search for facet query
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • searchForFacetValues

        default SearchForFacetResponse searchForFacetValues​(@Nonnull
                                                            SearchForFacetRequest query,
                                                            RequestOptions requestOptions)
        Search for a set of values within a given facet attribute. Can be combined with a query. This method enables you to search through the values of a facet attribute, selecting only a subset of those values that meet a given criteria.
        Parameters:
        query - Search for facet query
        requestOptions - Options to pass to this request
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • findObject

        default HitsWithPosition<T> findObject​(Predicate<T> match,
                                               Query query)
        FindFirstObject searches iteratively through the search response `Hits` field to find the first response hit that would match against the given `filterFunc` function.

        If no object has been found within the first result set, the function will perform a new search operation on the next page of results, if any, until a matching object is found or the end of results, whichever happens first.

        To prevent the iteration through pages of results, `doNotPaginate` parameter can be set to true. This will stop the function at the end of the first page of search results even if no object does match.

        If no result found `null` will be returned

        Parameters:
        match - The predicate to match
        query - The search Query
        Returns:
        HitsWithPosition
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • findObject

        default HitsWithPosition<T> findObject​(Predicate<T> match,
                                               Query query,
                                               boolean paginate)
        FindFirstObject searches iteratively through the search response `Hits` field to find the first response hit that would match against the given `filterFunc` function.

        If no object has been found within the first result set, the function will perform a new search operation on the next page of results, if any, until a matching object is found or the end of results, whichever happens first.

        To prevent the iteration through pages of results, `doNotPaginate` parameter can be set to true. This will stop the function at the end of the first page of search results even if no object does match.

        If no result found `null` will be returned

        Parameters:
        match - The predicate to match
        query - The search Query
        paginate - Should the method paginate or not
        Returns:
        HitsWithPosition
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization
      • findObject

        default HitsWithPosition<T> findObject​(Predicate<T> match,
                                               Query query,
                                               boolean paginate,
                                               RequestOptions requestOptions)
        FindFirstObject searches iteratively through the search response `Hits` field to find the first response hit that would match against the given `filterFunc` function.

        If no object has been found within the first result set, the function will perform a new search operation on the next page of results, if any, until a matching object is found or the end of results, whichever happens first.

        To prevent the iteration through pages of results, `doNotPaginate` parameter can be set to true. This will stop the function at the end of the first page of search results even if no object does match.

        If no result found `null` will be returned

        Parameters:
        match - The predicate to match
        query - The search Query
        paginate - Should the method paginate or not
        requestOptions - Options to pass to this request
        Returns:
        HitsWithPosition
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an http error code
        AlgoliaRuntimeException - When an error occurred during the serialization