1 search.module search_get_stats($modules = array())

Gets stats for total and remaining items to be indexed.

Parameters

array $modules: An array of module names whose index stats we are getting.

Return value

array: An array with the following keys:

  • remaining: The number of remaining items to be indexed.
  • total: The total number of indexable items.

File

core/modules/search/search.module, line 1443
Enables site-wide keyword searching.

Code

function search_get_stats($modules = array()) {
  if (empty($module)) {
    $modules = config_get('search.settings', 'search_active_modules');
  }
  $remaining = 0;
  $total = 0;
  foreach ($modules as $module) {
    if ($status = module_invoke($module, 'search_status')) {
      $remaining += $status['remaining'];
      $total += $status['total'];
    }
  }

  return array(
    'remaining' => $remaining,
    'total' => $total,
  );
}