While using Search API it does not index the translated/localized terms.
So does it mean translated terms are not searchable with Search API?
any clue? thanks
I think that this is core issue that the search index does not add the localized term to the index, I solved that by implementing hook_node_update_index($node) and fetching the localized term name by querying it from database because I don't know why i18n_taxonomy_localize_terms function doesn't load the term properly. my code is below:
function mymodule_node_update_index($node) {
$text = '';
$tid = key($node->your_taxonomy['und'][0]['tid']);
if($tid != 0) {
$query = db_select('locales_target', 'lt');
$query->addExpression('CONVERT(translation USING UTF8)', 'translation');
$query->join('locales_source', 'ls', 'ls.lid = lt.lid');
$query->condition('context', 'term:'.$tid.':name');
$text = $query->execute()->fetchColumn();
}
return $text;
}
Note: in my case the text is Arabic so I converted the field character set from blob to utf8.