You are here

function apachesolr_nodeapi in Apache Solr Search 6

Same name and namespace in other branches
  1. 5.2 apachesolr.module \apachesolr_nodeapi()
  2. 5 apachesolr.module \apachesolr_nodeapi()
  3. 6.3 apachesolr.module \apachesolr_nodeapi()
  4. 6.2 apachesolr.module \apachesolr_nodeapi()

Implementation of hook_nodeapi().

File

./apachesolr.module, line 597
Integration with the Apache Solr search application.

Code

function apachesolr_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'delete':
      _apachesolr_nodeapi_delete($node);
      break;
    case 'insert':

      // Make sure no node ends up with a timestamp that's in the future
      // by using time() rather than the node's changed or created timestamp.
      db_query("INSERT INTO {apachesolr_search_node} (nid, status, changed) VALUES  (%d, %d, %d)", $node->nid, $node->status, time());
      break;
    case 'update':
      _apachesolr_nodeapi_update($node);
      break;
  }
}