1 node.module node_update_index()

Implements hook_update_index().

File

core/modules/node/node.module, line 2464
The core module that allows content to be submitted to the site.

Code

function node_update_index() {
  $limit = (int) config_get('search.settings', 'search_cron_limit');

  // Index selected content types.
  $enabled_types = _node_search_get_types();
  $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE (d.sid IS NULL OR d.reindex <> 0) AND n.type IN (:enabled_types) ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(':enabled_types' => $enabled_types), array('target' => 'replica'));
  $nids = $result->fetchCol();
  if (!$nids) {
    return;
  }

  foreach (node_load_multiple($nids) as $node) {
    _node_index_node($node);
  }
}