function search_api_solr_update_8323 in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 search_api_solr.install \search_api_solr_update_8323()
Fix path to ukrainian.dict for Solr 8.2.0.
File
- ./
search_api_solr.install, line 1641 - Install, update and uninstall functions for the Search API Solr module.
Code
function search_api_solr_update_8323() {
foreach (search_api_solr_update_helper_get_field_type_configs() as $field_type_name => $field_type_config) {
if (!empty($field_type_config['field_type'])) {
if ('uk' === $field_type_config['field_type_language_code']) {
$save = FALSE;
foreach ($field_type_config['field_type'] as &$components) {
if (is_array($components)) {
foreach ($components as &$analyzers) {
if (is_array($analyzers)) {
foreach ($analyzers['filters'] as &$filter) {
if ('solr.MorfologikFilterFactory' === $filter['class']) {
$filter['dictionary'] = 'ua/net/nlp/ukrainian.dict';
$save = TRUE;
}
}
}
}
}
}
if ($save) {
search_api_solr_update_helper_save_field_type_config($field_type_name, $field_type_config);
}
}
}
}
}