You are here

function hook_apachesolr_index_document_build_ENTITY_TYPE in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 apachesolr.api.php \hook_apachesolr_index_document_build_ENTITY_TYPE()
  2. 7 apachesolr.api.php \hook_apachesolr_index_document_build_ENTITY_TYPE()

Build the documents before sending them to Solr.

Supports all types of hook_apachesolr_index_document_build_' . $entity_type($documents[$id], $entity, $env_id);

The function is the follow-up for apachesolr_update_index but then for specific entity types

_type

Parameters

$document:

$entity:

File

./apachesolr.api.php, line 390
Exposed Hooks in 6.x-3.x:

Code

function hook_apachesolr_index_document_build_ENTITY_TYPE(ApacheSolrDocument $document, $entity, $env_id) {

  // Index book module data.
  if (!empty($entity->book['bid'])) {

    // Hard-coded - must change if apachesolr_index_key() changes.
    $document->is_book_bid = (int) $entity->book['bid'];
  }
}