searchIndex method

Future<SearchResponse> searchIndex({
  1. required SearchForHits request,
  2. RequestOptions? requestOptions,
})

Perform a search operation targeting one index.

Implementation

Future<SearchResponse> searchIndex({
  required SearchForHits request,
  RequestOptions? requestOptions,
}) async {
  final response = await search(
    searchMethodParams: SearchMethodParams(requests: [request]),
    requestOptions: requestOptions,
  );
  return SearchResponse.fromJson(response.results.first);
}