You are here

function fuzzysearch_nodeapi in Fuzzy Search 6

Implementation of hook_nodeapi().

Remove node from index on deletion and queue node for indexing on insert.

File

./fuzzysearch.module, line 207
Module file for fuzzysearch module.

Code

function fuzzysearch_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'update':
    case 'insert':
      fuzzysearch_reindex($node->nid, 'fuzzysearch');
      break;
    case 'delete':
      db_query("DELETE FROM {fuzzysearch_index} WHERE nid = %d", $node->nid);
      break;
  }
}