You are here

function _biblio_index_node in Bibliography Module 7

Indexes a single biblio node.

Parameters

$node: The node to index.

bool $update: TRUE if the node is being updated, FALSE if inserted.

2 calls to _biblio_index_node()
biblio_node_insert in ./biblio.module
Implements hook_node_insert().
biblio_node_update in ./biblio.module
Implements hook_node_update().

File

./biblio.module, line 1191
Bibliography Module for Drupal.

Code

function _biblio_index_node($node, $update) {
  if ($node->type === 'biblio' && variable_get('biblio_index') && module_exists('search')) {
    if ($update) {

      // _node_index_node performs() a node_load() without resetting the
      // node_load() cache, so it would index the old version. We reset the cache
      // here. Don't assign node_load to $node because node_load resets e.g. the
      // menus mlid etc.
      $mynode = node_load($node->nid, NULL, TRUE);
      _node_index_node($mynode);
    }
    else {
      _node_index_node($node);
    }
    search_update_totals();
  }
}