You are here

function apachesolr_multilingual_apachesolr_field_mappings_alter in Apache Solr Multilingual 6.3

Same name and namespace in other branches
  1. 7 apachesolr_multilingual.module \apachesolr_multilingual_apachesolr_field_mappings_alter()

Implements hook_apachesolr_field_mappings_alter()

TODO needs review!

File

./apachesolr_multilingual.module, line 1001
Multilingual search using Apache Solr.

Code

function apachesolr_multilingual_apachesolr_field_mappings_alter(&$mappings, $entity_type) {
  $multilingual_mapping = array(
    'apachesolr_term_reference_indexing_callback' => 'apachesolr_multilingual_term_reference_indexing_callback',
  );
  foreach ($mappings as &$mapping) {
    if (isset($mapping['indexing_callback']) && is_array($mapping['indexing_callback'])) {
      foreach ($mapping['indexing_callback'] as $key => $value) {
        if (isset($multilingual_mapping[$value])) {
          $mapping['indexing_callback'][$key] = $multilingual_mapping[$value];
        }
      }
    }
  }
}