clearIndex method

void clearIndex()

ClearIndex

Remove the index’s content, but keep settings and index-specific API keys untouched. Equivalent to Clear objects.

Implementation

void clearIndex() {
  if (!_committed) {
    _actions.add(AlgoliaBatchRequest(action: 'clear', body: {}));
  } else {
    throw StateError(
        'This batch has been committed and can no longer be changed.');
  }
}