You are here

function apachesolr_comment in Apache Solr Search 6

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

Implementation of hook_comment().

Mark nodes as needing re-indexing if comments are added or changed. Like search_comment().

File

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

Code

function apachesolr_comment($edit, $op) {
  $edit = (array) $edit;
  switch ($op) {

    // Reindex the node when comments are added or changed
    case 'insert':
    case 'update':
    case 'delete':
    case 'publish':
    case 'unpublish':

      // TODO: do we want to skip this if we are excluding comments
      // from the index for this node type?
      apachesolr_mark_node($edit['nid']);
      break;
  }
}