search_wipe

5 search.module search_wipe($sid = NULL, $type = NULL, $reindex = FALSE)
6 search.module search_wipe($sid = NULL, $type = NULL, $reindex = FALSE)

Wipes a part of or the entire search index.

Parameters

$sid: (optional) The SID of the item to wipe. If specified, $type must be passed too.

$type: (optional) The type of item to wipe.

4 calls to search_wipe()

1 string reference to 'search_wipe'

File

modules/search/search.module, line 230
Enables site-wide keyword searching.

Code

function search_wipe($sid = NULL, $type = NULL, $reindex = FALSE) {
  if ($type == NULL && $sid == NULL) {
    module_invoke_all('search', 'reset');
  }
  else {
    db_query("DELETE FROM {search_dataset} WHERE sid = %d AND type = '%s'", $sid, $type);
    db_query("DELETE FROM {search_index} WHERE sid = %d AND type = '%s'", $sid, $type);
    // Don't remove links if re-indexing.
    if (!$reindex) {
      db_query("DELETE FROM {search_node_links} WHERE sid = %d AND type = '%s'", $sid, $type);
    }
  }
}

Comments

For D7 see search_reindex()

For D7 see
search_reindex()

Login or register to post comments