function _drush_core_search_status

3.x search.drush.inc _drush_core_search_status()
4.x search.drush.inc _drush_core_search_status()
2 calls to _drush_core_search_status()

File

commands/core/search.drush.inc, line 12

Code

function _drush_core_search_status() {
  $remaining = 0;
  $total = 0;
  if (drush_drupal_major_version() >= 7) {
    foreach (module_implements('search_status') as $module) {
      $status = module_invoke($module, 'search_status');
      $remaining += $status['remaining'];
      $total += $status['total'];
    }
  }
  else {
    foreach (module_implements('search') as $module) {
      // Special case. Apachesolr recommends disabling core indexing with
      // search_cron_limit = 0. Need to avoid infinite status loop.
      if ($module == 'node' && variable_get('search_cron_limit', 10) == 0) {
        continue;
      }
      $status = module_invoke($module, 'search', 'status');
      $remaining += $status['remaining'];
      $total += $status['total'];
    }
  }
  return array($remaining, $total);
}