You are here

function hook_search_reset in Drupal 7

Take action when the search index is going to be rebuilt.

Modules that use hook_update_index() should update their indexing bookkeeping so that it starts from scratch the next time hook_update_index() is called.

Related topics

1 function implements hook_search_reset()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

node_search_reset in modules/node/node.module
Implements hook_search_reset().
1 invocation of hook_search_reset()
search_reindex in modules/search/search.module
Clears a part of or the entire search index.

File

modules/search/search.api.php, line 73
Hooks provided by the Search module.

Code

function hook_search_reset() {
  db_update('search_dataset')
    ->fields(array(
    'reindex' => REQUEST_TIME,
  ))
    ->condition('type', 'node')
    ->execute();
}