diff --git a/apachesolr_multilingual.module b/apachesolr_multilingual.module index 3aef2c0..b0ece0c 100644 --- a/apachesolr_multilingual.module +++ b/apachesolr_multilingual.module @@ -213,7 +213,16 @@ function apachesolr_multilingual_apachesolr_index_documents_alter(&$documents, $ // when original document is removed. See apachesolr_index_delete_entity_from_index(). $additional_documents[$id]->sm_parent_document_id = array($document->id); - apachesolr_index_node_solr_document($additional_documents[$id], $entity, $entity_type, $env_id); + list(, , $bundle) = entity_extract_ids('node', $entity); + //Get the callback array to add stuff to the document + $document_callbacks = apachesolr_entity_get_callback($entity_type, 'document callback', $bundle); + $documents = array(); + foreach ($document_callbacks as $document_callback) { + // Call a type-specific callback to add stuff to the document. + // Generic use case for future reference. Callbacks can + // allow you to send back multiple documents + $documents = array_merge($documents, $document_callback($additional_documents[$id], $entity, $entity_type, $env_id)); + } // Recursive call to deal with 'apachesolr_multilingual_index_translations' aka CLIR and title field, see above and below apachesolr_multilingual_apachesolr_index_documents_alter($additional_documents, $entity, $entity_type, $env_id);