refresh method

Future<bool> refresh(
  1. String index,
  2. String collection
)

Forces an immediate reindexation of the provided collection.

When writing or deleting documents in Kuzzle, the changes need to be indexed before being reflected in the search results. By default, this operation can take up to 1 second.

Warning Forcing immediate refreshes comes with performance costs, and should only performed when absolutely necessary.

Implementation

Future<bool> refresh(String index, String collection) async {
  final response = await kuzzle.query(KuzzleRequest(
    controller: name,
    action: 'refresh',
    index: index,
    collection: collection,
  ));

  return response.status == 200 && response.result == null;
}