Fine-tune your language fallback configuration
Depending on your Sitecore solution, you can make a few adjustments to your language fallback configuration, including to the search index and to language fallback settings using a patch file.
Set up a search index to handle language fallback
If your solution relies on Sitecore’s content search (item buckets) and you want to use language fallback, you must set up the particular search index to handle item- or field-level fallback.
To set up a search index to handle language fallback:
-
Enable the relevant fallback modes by adding (or patching) the following XML child elements for the relevant search index and setting their inner value to
true. Apply these changes using a patch file. The patch file can have any name and must be placed in the/platform/folder of your source code. -
Perform a full rebuild of the affected indexes.
If your configuration file does not contain these elements, use the Sitecore.ContentSearch.Solr.Index.Master.config file as an example of how to apply them.
No data is added to the index if there is no version of the field in the fallback language. However, in this case, the Sitecore data API returns items with fallback field values, and therefore we recommend that you enforce version presence on these items.
Configure the Sitecore.LanguageFallback.config file
You can configure the following settings by using a patch file to override the defaults in Sitecore.LanguageFallback.config. The patch file can have any name and must be placed in the /platform/ folder of your source code.
-
DefaultCacheSize- determines the default cache size that stores the language fallback field values. The default value is 20MB.If you want different cache sizes on a specific database, use the following code sample. The sample is available in the configuration file.
-
AllowVaryFallbackSettingsPerLanguage- enables you to have different fallback settings for the same field in different languages. The default value is false.ImportantIf you enable this feature, performance is considerably degraded.