function search_cron in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/search/search.module \search_cron()
Implements hook_cron().
Fires updateIndex() in the plugins for all indexable active search pages, and cleans up dirty words.
See also
File
- core/
modules/ search/ search.module, line 187 - Enables site-wide keyword searching.
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');
/** @var $search_page_repository \Drupal\search\SearchPageRepositoryInterface */
$search_page_repository = \Drupal::service('search.search_page_repository');
foreach ($search_page_repository
->getIndexableSearchPages() as $entity) {
$entity
->getPlugin()
->updateIndex();
}
}