jahia v8 modules

Search does not find non internationalized content when a website only has one language different from english

Question

When a website is configured with only one language and if this language is not english, the search will have difficulty to find results when the search term contains specific words and content being searched has not been internationalized.

 

Cause

By default, content without translation nodes are indexed using the english analyzer, while the search will be done using the default language of the site.

For example, if French is the default language of the site, the analyzer automatically applies changes to the term used in the search, "bulletin" will automatically be converted to "buletin" and will fail finding results (since no such words exists in the index). Similar cases were identified for words ending with the letter "r" or "e". 

Other words would typically return results, giving the impression that the search is partially working.

Solution

To address this particular situation, it is best to configure the default language code via configuration:

  • Open jahia.properties
  • Set the property org.jahia.multilang.default_language_code = fr 
  • Restart your server
  • Access the tools / Search Engine Management
  • Start Whole repository re-indexing

Note that this configuration change will apply across all sites.