function _drush_search_status

8.0.x search.drush.inc _drush_search_status()
6.x search.drush.inc _drush_search_status()
7.x search.drush.inc _drush_search_status()
5.x search.drush.inc _drush_search_status()
master search.drush.inc _drush_search_status()
2 calls to _drush_search_status()

File

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

Code

function _drush_search_status() {
  $remaining = 0;
  $total = 0;
  if (drush_drupal_major_version() >= 7) {
    foreach (variable_get('search_active_modules', array('node', 'user')) 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');
      if (isset($status['remaining']) && isset($status['total'])) {
        $remaining += $status['remaining'];
        $total += $status['total'];
      }
    }
  }
  return array($remaining, $total);
}