You are here

function apachesolr_og_apachesolr_index_document_build_node in Apache Solr Organic Groups Integration 6.3

Implements hook_apachesolr_index_document_build_ENTITY_TYPE().

Parameters

ApacheSolrDocument $document:

type $node:

type $env_id:

File

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

Code

function apachesolr_og_apachesolr_index_document_build_node(ApacheSolrDocument $document, $node, $env_id) {

  // 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);
  }
}