You are here

function search_config_update_index in Search configuration 5

Implementation of hook_update_index()

File

./search_config.module, line 313
Used to configure the advanced search form and other search behaviour.

Code

function search_config_update_index() {

  // This hook is only called when the search module is enabled
  // The function_exists check can be removed, but there is no harm in leaving it in
  if (function_exists('search_wipe')) {
    $types = node_get_types('names');
    $remove = variable_get('search_config_disable_index_type', array());
    foreach ($remove as $type => $value) {
      if (isset($types[$type]) && $value === $type) {
        $result = db_query("SELECT n.nid FROM {node} n INNER JOIN {search_dataset} s ON n.nid=s.sid WHERE n.type = '%s'", $type);
        while ($data = db_fetch_object($result)) {
          search_wipe($data->nid, 'node');
        }
      }
    }
  }
}