search_wipe

Versions
4.6
search_wipe($sid = NULL, $type = NULL)
4.7 – 6
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 functions call search_wipe()

node_delete in modules/node.module
Ask for confirmation, and delete the node.
search_admin in modules/search.module
Menu callback; displays the search module settings page.
search_index in modules/search.module
Update the full-text search index for a particular item.
update_129 in database/updates.inc

Code

modules/search.module, line 176

<?php
function search_wipe($sid = NULL, $type = NULL) {
  if ($type == NULL && $sid == NULL) {
    module_invoke_all('search', 'reset');
  }
  else {
    db_query("DELETE FROM {search_index} WHERE sid = %d AND type = '%s'", $sid, $type);
    db_query("DELETE FROM {search_index} WHERE fromsid = %d AND fromtype = '%s'", $sid, $type);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.