function search_cron

Same name in other branches
  1. 9 core/modules/search/search.module \search_cron()
  2. 8.9.x core/modules/search/search.module \search_cron()
  3. 10 core/modules/search/search.module \search_cron()
  4. 11.x core/modules/search/search.module \search_cron()

Implements hook_cron().

Fires hook_update_index() in all modules and cleans up dirty words.

See also

search_dirty()

File

modules/search/search.module, line 356

Code

function search_cron() {
    // We register a shutdown function to ensure that search_total is always up
    // to date.
    drupal_register_shutdown_function('search_update_totals');
    foreach (variable_get('search_active_modules', array(
        'node',
        'user',
    )) as $module) {
        // Update word index
        module_invoke($module, 'update_index');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.