You are here

function hook_apachesolr_index_documents_alter in Apache Solr Search 8

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

Alter the prepared documents from one entity before sending them to Solr.

Parameters

$documents: Array of ApacheSolrDocument objects.

object $entity:

string $entity_type:

string $env_id: The machine name of the environment.

1 invocation of hook_apachesolr_index_documents_alter()
apachesolr_convert_entity_to_documents in ./apachesolr.index.inc
The given entity is converted to an array via the callback specified in the entity type's info array. The array that the entity is converted to is the model of the document sent to the Apache Solr server for indexing. This function allows…

File

./apachesolr.api.php, line 424
Exposed Hooks in 7.x:

Code

function hook_apachesolr_index_documents_alter(array &$documents, $entity, $entity_type, $env_id) {

  // Do whatever altering you need here
}