function _auto_index_index_node in Auto Index 6
Same name and namespace in other branches
- 7 auto_index.module \_auto_index_index_node()
2 calls to _auto_index_index_node()
- auto_index_comment in ./
auto_index.module - auto_index_nodeapi in ./
auto_index.module - @file Auto-index: Automatically indexes node content on update.
File
- ./
auto_index.module, line 46 - Auto-index: Automatically indexes node content on update.
Code
function _auto_index_index_node(&$node) {
// Static variable to keep track of any node ids already indexed.
static $indexed_nodes = array();
// Extract the node ID
$node_id = is_array($node) ? $node['nid'] : $node->nid;
// Check if the node ID has already been indexed.
if (array_search($node_id, $indexed_nodes) === false) {
// Ensure we force the cache to be updated so latest content is indexed.
$node_obj = node_load($node_id, NULL, TRUE);
// Do the indexing of this node only.
_node_index_node($node_obj);
// Update search totals.
search_update_totals();
// Append to array to ensure node only indexed once per action.
$indexed_nodes[] = $node_id;
}
}