searchForHits method

Future<Iterable<SearchResponse>> searchForHits({
  1. required List<SearchForHits> requests,
  2. SearchStrategy? strategy,
  3. RequestOptions? requestOptions,
})

Calls the search method but with certainty that we will only request Algolia records (hits).

Implementation

Future<Iterable<SearchResponse>> searchForHits({
  required List<SearchForHits> 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) => SearchResponse.fromJson(e)));
}