You are here

function synonyms_search_term_update_index in Synonyms 7

Implements hook_term_update_index().

File

synonyms_search/synonyms_search.module, line 96
Provides synonyms integration with searching.

Code

function synonyms_search_term_update_index($term) {
  $bundle = taxonomy_vocabulary_load($term->vid);
  $bundle = field_extract_bundle('taxonomy_term', $bundle);
  $behavior_implementations = synonyms_behavior_get('search', 'taxonomy_term', $bundle, TRUE);
  $synonyms = array();
  foreach ($behavior_implementations as $implementation) {
    $synonyms = array_merge($synonyms, $implementation['object']
      ->extractSynonyms($term));
  }
  return implode(', ', $synonyms);
}