search_reindex

Versions
7
search_reindex($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_reindex()

node_delete_multiple in modules/node/node.module
Delete multiple nodes.
search_admin_settings_submit in modules/search/search.admin.inc
Submit callback.
search_index in modules/search/search.module
Update the full-text search index for a particular item.
search_reindex_confirm_submit in modules/search/search.admin.inc
Handler for wipe confirmation

Code

modules/search/search.module, line 263

<?php
function search_reindex($sid = NULL, $type = NULL, $reindex = FALSE) {
  if ($type == NULL && $sid == NULL) {
    module_invoke_all('search_reset');
  }
  else {
    db_delete('search_dataset')
      ->condition('sid', $sid)
      ->condition('type', $type)
      ->execute();
    db_delete('search_index')
      ->condition('sid', $sid)
      ->condition('type', $type)
      ->execute();
    // Don't remove links if re-indexing.
    if (!$reindex) {
      db_delete('search_node_links')
        ->condition('sid', $sid)
        ->condition('type', $type)
        ->execute();
    }
  }
}
?>
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.