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 Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description 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.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.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.default SearchResult<T>search(Query query)Method used for querying an index.default SearchResult<T>search(Query query, RequestOptions requestOptions)Method used for querying an index.default CompletableFuture<SearchResult<T>>searchAsync(Query query)Method used for querying an index.default CompletableFuture<SearchResult<T>>searchAsync(Query query, RequestOptions requestOptions)Method used for querying an index.default SearchForFacetResponsesearchForFacetValues(SearchForFacetRequest query)Search for a set of values within a given facet attribute.default SearchForFacetResponsesearchForFacetValues(SearchForFacetRequest query, RequestOptions requestOptions)Search for a set of values within a given facet attribute.default CompletableFuture<SearchForFacetResponse>searchForFacetValuesAsync(SearchForFacetRequest query)Search for a set of values within a given facet attribute.default CompletableFuture<SearchForFacetResponse>searchForFacetValuesAsync(SearchForFacetRequest query, RequestOptions requestOptions)Search for a set of values within a given facet attribute.-
Methods inherited from interface com.algolia.search.SearchIndexBase
getClazz, getConfig, getTransport, getUrlEncodedIndexName, waitTask, waitTask
-
-
-
-
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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
searchForFacetValuesAsync
default CompletableFuture<SearchForFacetResponse> searchForFacetValuesAsync(@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 hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
searchForFacetValuesAsync
default CompletableFuture<SearchForFacetResponse> searchForFacetValuesAsync(@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 queryrequestOptions- Options to pass to this request- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 matchquery- The search Query- Returns:
- HitsWithPosition
- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 matchquery- The search Querypaginate- Should the method paginate or not- Returns:
- HitsWithPosition
- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- 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 matchquery- The search Querypaginate- Should the method paginate or notrequestOptions- Options to pass to this request- Returns:
- HitsWithPosition
- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an http error codeAlgoliaRuntimeException- When an error occurred during the serialization
-
-