You are here

function searchindex_wipe_truncate_table in Search Index Wipe 7

Same name and namespace in other branches
  1. 8 searchindex_wipe.module \searchindex_wipe_truncate_table()
2 calls to searchindex_wipe_truncate_table()
drush_searchindex_wipe in ./searchindex_wipe.drush.inc
searchindex_wipe_confirm_submit in ./searchindex_wipe.module
Confirmation form submit. Truncates all search related tables.

File

./searchindex_wipe.module, line 86
Enables wipe of search index.

Code

function searchindex_wipe_truncate_table() {

  // Taken code from drupal_uninstall_schema.
  $schema = drupal_get_schema_unprocessed('search');
  foreach ($schema as $table_name => $table) {

    // Truncate search related tables.
    db_truncate($table_name)
      ->execute();
  }
  drupal_set_message(t('Search Index Cleared, Please rebuilt the index by running cron.'));
}