After updating search api I got the following notice:
There are some language-specific field types missing in schema of Solr server xyz: zh-hans.
This language specific field type is present in the solr config under text_zh_hans.
The code is checking for text_zh-hans.
/**
* {@inheritdoc}
*/
public function getSchemaLanguageStatistics() {
// @todo iterate over all indexes in case of cloud?
$available = $this->getSolrConnector()->pingCore();
$stats = [];
foreach (\Drupal::languageManager()->getLanguages() as $language) {
$solr_field_type_name = 'text' . '_' . $language->getId();
$stats[$language->getId()] = $available ? $this->isPartOfSchema('fieldTypes', $solr_field_type_name) : FALSE;
}
return $stats;
}
So the language check of language ids with a dash can't work.. Further in the code I saw something like this in the setSpellcheck method using data from getSchemaLanguageStatistics.
// Convert zk-hans to zk_hans.
$dictionaries[] = str_replace('-', '_', $language_id);
Maybe do this in getSchemaLanguageStatistics ..
Comment | File | Size | Author |
---|---|---|---|
#2 | 3136510.patch | 867 bytes | mkalkbrenner |
Comments
Comment #2
mkalkbrennerYou're right.
Comment #4
mkalkbrennerComment #6
jcnventura CreditAttribution: jcnventura at 1xINTERNET commentedWell, this broke pt-pt again. Now I get:
There are some language-specific field types missing in schema of Solr server localhost: pt-pt.
This had been fixed previously in #3091574: Dynamic solr field type check encodes special characters.
So, we need to replace dashes with underscores in the case of zh-hans and zh-hant, but not in the case of pt-pt and pt-br. Not sure what the best way to solve this is. Maybe change the config like was done for Portuguese in #3087744: Update the Portuguese config to use the langcodes used by Drupal, or to change the line now committed from
to