SearchResult constructor
SearchResult(
- Kuzzle kuzzle, {
- KuzzleRequest? request,
- KuzzleResponse? response,
Implementation
SearchResult(
this.kuzzle, {
this.request,
this.response,
}) {
lang = request!.lang;
controller = request!.controller;
searchAction = 'search';
scrollAction = 'scroll';
final result = response!.result as Map<String, dynamic>;
if (result.containsKey('aggregations')) {
aggregations = result['aggregations'] as Map<String, dynamic>?;
}
if (result.containsKey('hits')) {
hits = result['hits'] as List<dynamic>?;
fetched = hits!.length;
}
if (result.containsKey('total')) {
total = result['total'] as int?;
}
}