Multilingual functionality explained
In this article you will find:
Goal
This article is written for developers to explain and show how the multilingual functionality is working and what changes it makes to the indexing process.
Prerequisite
Install the Hawksearch Connector: Installing the Connector
Introduction to multilingual functionality: Multilingual: Overview
Set-up the multilingual: Multilingual: Setup
How is the multilingual working
The multilingual functionality is an easy way for sorting an filtering the content based on a language of the content items.
When enabling the multilingual and creating content on different languages, the items are indexed in a different languages, so the items can be divided based on the language.
What it does behind the scene is:
When the Reindex is triggered the UpdateIndex method is called. There is a check whether the multilingual field is selected or not.
If the field is selected, the method is called ProcessMultilingualFields(). There you loop through the fields of the document and a suffix is added to those that are different from language, permissions and denials.
Example:
As mentioned earlier to almost every field is added a language suffix. The reason is that there are three fields that do not need suffix: permissions, denials and language.
The permissions and denials are two fields that are added to the document, only when the Filter by permissions functionality is on. You can read more about this here: Filter by Permissions: Setup
The third field that remains unchanged is “language”. Its value carries language information (language abbreviation) and there is no need to add a suffix.
How works the multilingual in the dashboard
In order the language options to work properly, Visitor targets should be set in the Workbench of the engine. More information on how to do this can be found in this article: Multilingual: Setup
The Visibility target is a rule on how to divide the documents, based on a condition. There should be set as a parameter the “language“ and as value the chosen languages. For each language there should be a separate visitor target.
If the Multilingual is enabled, but there is only one language, there will be no menu with the language options, but the documents fields will still be indexed with the suffixes.