You are here

function apachesolr_taxonomy in Apache Solr Search 6.3

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

Implements hook_taxonomy().

Mark nodes as needing re-indexing if a term name changes.

Performance issue with Mysql To know why PDO in drupal does not support UPDATE and JOIN at once. @todo the rest, such as term deletion.

See also

http://drupal.org/node/592522

http://api.drupal.org/api/drupal/includes--database--database.inc/functi...

File

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

Code

function apachesolr_taxonomy($op, $type, $edit) {
  if ($type == 'term' && $op == 'update') {
    $table = apachesolr_get_indexer_table('node');
    $query = "UPDATE {{$table}} asn\n      INNER JOIN {term_node} tn ON asn.entity_id = tn.nid SET asn.changed = '%s'\n      WHERE tn.tid ='%s'";
    $result = db_query($query, array(
      APACHESOLR_REQUEST_TIME,
      $term->tid,
    ));
  }

  // TODO: the rest, such as term deletion.
}