You are here

public function SearchIndexWipeCommands::wipe in Search Index Wipe 8

Wipes Search module generated index.

@command searchindex-wipe @aliases siw @usage drush9_example:hello akanksha --msg Truncates search index tables.

File

src/Commands/SearchIndexWipeCommands.php, line 23

Class

SearchIndexWipeCommands
Class SearchIndexWipeCommands.

Namespace

Drupal\searchindex_wipe\Commands

Code

public function wipe() {
  if ($this
    ->io()
    ->confirm(dt('Are you sure you want to clear Search index?'))) {
    searchindex_wipe_truncate_table();
  }
  else {
    throw new UserAbortException();
  }
}