searchForFacets method

Future<Iterable<SearchForFacetValuesResponse>> searchForFacets({
  1. required List<SearchForFacets> requests,
  2. SearchStrategy? strategy,
  3. RequestOptions? requestOptions,
})

Calls the search method but with certainty that we will only request Algolia facets.

Implementation

Future<Iterable<SearchForFacetValuesResponse>> searchForFacets({
  required List<SearchForFacets> requests,
  SearchStrategy? strategy,
  RequestOptions? requestOptions,
}) async {
  final request = SearchMethodParams(requests: requests, strategy: strategy);
  return search(searchMethodParams: request, requestOptions: requestOptions)
      .then((res) =>
          res.results.map((e) => SearchForFacetValuesResponse.fromJson(e)));
}