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.
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 