search method
Searches documents.
There is a limit to how many documents can be returned by a single search query.
That limit is by default set at 10000 documents, and you can't get over it even with the from and size pagination options.
To handle larger result sets, you have to either create a cursor by providing a value to the scroll option or, if you sort the results, by using the Elasticsearch search_after command.
Implementation
Future<SearchResult> search(
String index,
String collection, {
Map<String, dynamic> query = const {},
int? from,
int? size,
String? scroll,
String? lang,
}) async {
final request = KuzzleRequest(
action: 'search',
collection: collection,
controller: name,
index: index,
body: query,
from: from,
size: size,
scroll: scroll,
lang: lang,
);
final response = await kuzzle.query(request);
return SearchResult(kuzzle, request: request, response: response);
}