Czech and Norwegian languages may cause indexing errors


Description

Sitecore XP automatically creates dynamic fields for certain languages. A message similar to the following might be found in the logs when using the Solr search provider and indexing items in the Czech or Norwegian language:

9524 2015:06:25 14:52:03 
WARN Crawler : AddRecursive DoItemAdd failed - {6601373B-C31A-43D7-8DD8-6429ACA38298} Exception: SolrNet.Exceptions.SolrConnectionException Message: <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">400</int><int name="QTime">98</int></lst>
<lst name="error"><str name="msg">

ERROR:
[doc=sitecore://master/{110d559f-dea5-42ea-9c1c-8a5df7e70ef9}?lang=cs-cz&amp;ver=1&amp;ndx=sitecore_master_index] unknown field 'title_t_cs'</str>
<int name="code">400</int></lst>
</response>

Solution

Option 1

  1. Modify the Solr schema file by adding two new dynamic field definitions:
    <dynamicField name="*_t_cs" type="text_cz" indexed="true" stored="true" />
    <dynamicField name="*_t_nb" type="text_no" indexed="true" stored="true" />
  2. Reload every Solr core with the modified Solr schema, or restart the Solr server.
  3. Restart Sitecore instances that reference the Solr server to pull information about the updated Solr schema.

    Note: If you populate the Solr schema using Sitecore, the changes will be overwritten. Normally, this step is only run during deployment of a new environment or after upgrading to a later version of the product. Check Option 2 if you want to make sure that the changes cannot be accidentally overwritten.

Option 2

  1. Customize the Solr schema population logic using the example provided in the article:
  2. Repopulate the schema.