You are here

function apachesolr_og_apachesolr_update_index in Apache Solr Organic Groups Integration 6.2

Implementation of hook_apachesolr_update_index().

File

./apachesolr_og.module, line 54
Integrates Organic Group info with Apache Solr search application.

Code

function apachesolr_og_apachesolr_update_index(&$document, $node) {

  // Index group posts
  if (!empty($node->og_groups)) {
    foreach ($node->og_groups as $gid) {
      $document
        ->setMultiValue(apachesolr_og_gid_key(), $gid);
    }
  }
  elseif (isset($node->og_description) && variable_get('apachesolr_og_groupnode', 0)) {

    // Index the group node itself as in the group.
    $document
      ->setMultiValue(apachesolr_og_gid_key(), $node->nid);
  }
}