0)")); return array('remaining' => $remaining, 'total' => $total); } } /** * Implementation of hook_update_index(). */ function project_issue_search_index_update_index() { $limit = (int) variable_get('search_cron_limit', 100); $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 n.type = 'project_issue' AND (d.sid IS NULL OR d.reindex <> 0) ORDER BY d.reindex ASC, n.nid ASC", 0, $limit); while ($node = db_fetch_object($result)) { _project_issue_search_index_index_node($node); } } /** * Index a single node. * * @param $node * The node to index. */ function _project_issue_search_index_index_node($node) { $node = node_load($node->nid); // Build the node body. $node->build_mode = NODE_BUILD_SEARCH_INDEX; $node = node_build_content($node, FALSE, FALSE); $node->body = drupal_render($node->content); $text = '