search_cron

search_cron()

Implements hook_cron().

Fires updateIndex() in the plugins for all indexable active search pages, and cleans up dirty words.

See also

search_dirty()

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();
  }
}
doc_Drupal
2016-10-29 09:40:55
Comments
Leave a Comment

Please login to continue.