hook_search_status

Versions
7
hook_search_status()

Report the stutus of indexing.

Return value

An associative array with the key-value pairs:

  • 'remaining': The number of items left to index.
  • 'total': The total number of items to index.

Related topics

Code

modules/search/search.api.php, line 82

<?php
function hook_search_status() {
  $total = db_query('SELECT COUNT(*) FROM {node} WHERE status = 1')->fetchField();
  $remaining = db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE n.status = 1 AND d.sid IS NULL OR d.reindex <> 0")->fetchField();
  return array('remaining' => $remaining, 'total' => $total);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.