function search_api_solr_update_8201 in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 search_api_solr.install \search_api_solr_update_8201()
- 8.2 search_api_solr.install \search_api_solr_update_8201()
Fix suggester field type.
File
- ./
search_api_solr.install, line 569 - Install, update and uninstall functions for the Search API Solr module.
Code
function search_api_solr_update_8201() {
foreach (search_api_solr_update_helper_get_field_type_configs() as $field_type_name => $field_type_config) {
if (!empty($field_type_config['solr_configs']) && !empty($field_type_config['solr_configs']['searchComponents'])) {
foreach ($field_type_config['solr_configs']['searchComponents'] as &$component) {
if ($component['name'] === 'suggest') {
foreach ($component['lst'] as &$lst) {
foreach ($lst['str'] as &$entry) {
if ($entry['name'] === 'field') {
$entry['VALUE'] = 'twm_suggest';
search_api_solr_update_helper_save_field_type_config($field_type_name, $field_type_config);
break;
}
}
}
}
}
}
}
}