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 ..

CommentFileSizeAuthor
#2 3136510.patch867 bytesmkalkbrenner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

paulvb created an issue. See original summary.

mkalkbrenner’s picture

Version: 8.x-3.9 » 4.x-dev
Status: Active » Needs review
FileSize
867 bytes

You're right.

  • mkalkbrenner committed 2861000 on 4.x
    Issue #3136510 by mkalkbrenner, paulvb: Incorrect notice language...
mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jcnventura’s picture

Well, 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

$solr_field_type_name = 'text' . '_' . str_replace('-', '_', $language->getId());

to

$solr_field_type_name = 'text' . '_' . str_replace('zh-han', 'zh_han', $language->getId());