function search_cron in Drupal 8
Same name and namespace in other branches
- 4 modules/search.module \search_cron()
- 5 modules/search/search.module \search_cron()
- 6 modules/search/search.module \search_cron()
- 7 modules/search/search.module \search_cron()
- 9 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.
File
- core/
modules/ search/ search.module, line 177 - Enables site-wide keyword searching.
Code
function search_cron() {
/** @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();
}
}