You are here

function similar_reset_indices in Similar Entries 7.2

Same name and namespace in other branches
  1. 6.2 similar.module \similar_reset_indices()

Clears all Similar Entries indices.

1 call to similar_reset_indices()
similar_cron in ./similar.module
Implements hook_cron().

File

./similar.module, line 45
Module that shows a block listing similar entries. NOTE: Uses MySQL's FULLTEXT indexing for MyISAM tables.

Code

function similar_reset_indices() {
  $indices = similar_get_indices();
  if (!empty($indices)) {
    foreach ($indices as $field => $info) {
      if (isset($info['table']) && isset($info['index'])) {
        if (db_table_exists($info['table']) && db_index_exists($info['table'], $info['index'])) {
          db_drop_index($info['table'], $info['index']);
        }
      }
    }
  }
  variable_del(SIMILAR_INDICES);
  similar_index_fields();
}