IndexRecordMultilingualSystemFieldMapping
This page provides generated reference documentation for the IndexRecordMultilingualSystemFieldMapping data model.
A multilingual field in index record containers
Overview
| Property | Summary |
|---|---|
| isMultiLanguage | Specifies if the index field is multilingual. |
| translationMode | Specifies the method with which the values of the field are translated. |
| translationProcess | The process provides the translations for the value of a field in the specified language. |
| mappingProcess | Process, which provides a mapping for all possible values (keywords) to their respective translations. |
| templateProcess | Defines a process which delivers a template for the index field. |
| isFilterable | Specifies, whether a field or filterextension is filterable. Filterable fields will be available for selection by a user. |
| isLookupFilter | For a column of the lookup component, specifies whether to search for data in it. That is, if a term is entered in the lookup component, it searches for… |
isMultiLanguage
Type: Boolean
Specifies if the index field is multilingual.
The index only uses the languages that are specified in the property multilingualismIndexSearchLocales of ___CONFIGURATION.
translationMode
Type: EIndexTranslationMode
Requires: isMultiLanguage property group
Specifies the method with which the values of the field are translated.\
INTERN: Directly uses the project's language packs for the translation. The original value of the field is used as the key.\STATIC: Uses a static mapping for the translation, which is set up via themappingProcess. This option is mainly intended for the translation of keywords and values that are as unique as possible. IMPORTANT: The created mapping is kept in the RAM during the entire indexing process. Large amounts of values and large field contents can lead to a memory overflow.\DYNAMIC: Uses the specifiedtranslationProcessfor the translation. IMPORTANT: This option can have a major negative impact on the speed of indexing. The process is called once for each entry in the field for each language for each index document. Reduce ressource heavy executions (e.g. entities.get*) to a minimum.
All translation methods are ignored if atemplateProcessis defined for the field.
translationProcess
Type: String
Requires: translationMode property group
The process provides the translations for the value of a field in the specified language.
The process is called once for each defined language with the corresponding locale.
It should only provide the translation for this language as the return value.
The locale of the target language ($local.locale) and the original value ($local.value) are passed to the process.
IMPORTANT: It is advised to reduce ressource heavy executions (e.g. entities.get*) to a minimum as it can have major negative performance impact as
indexing processes will be called repeatedly!
var locale = vars.get("$local.locale");
var keyword = vars.get("$local.value");
result.string(translate.text(keyword, locale));
mappingProcess
Type: String
Requires: translationMode property group
Process, which provides a mapping for all possible values (keywords) to their respective translations.
This process is called once for each language before indexing.
As result a json object containing the complete mapping for the requested language is expected.
The requested locale of the target language is passed via ($local.locale) to the process.
// the requested language locale
var locale = vars.getString("$local.locale")
// Value of in DB (keyword) -> translation
var mapping = {};
mapping["f"] = translate.text("Female", locale);
mapping["m"] = translate.text("Male", locale);
// possible result for locale 'de'.
var mapping = {
"f":"Weiblich"
"m":"Männlich"
};
templateProcess
Type: String
Defines a process which delivers a template for the index field.
The process allows to create a composed field using the values of other RecordFields in the document.
The template is generated once before indexing. If the field is multilingual, a template is created for each language of the index.
During indexing, the placeholders in the template are filled with the contents of the fields at the specified position of the indexFieldMappings.
NOTE: The indices of the placeholders start at 0, so the actual position is the number viewed in the recordFieldMappings
editor minus 1, e.g. #TITLE = 2 (editor) - 1 -> actual index 1.
If the field of the template is multilingual, the entries in the corresponding language are adopted from other multilingual fields.
Otherwise, the template will only use the value of the default language.
This option can only be used by single valued fields (isMultiValued == false).
If this field is defined as multilingual (isMultiLangauge == true) all other translation settings are ignored.
The locale of the language can be retrieved via vars.get("$local.locale").
var locale = vars.get("$local.locale");
result.string("{0} {1} | " + translate("Phone", locale) + ": {2} | " + translate("Email", local) + ": {3}");
// result (en): "{0} {1} | Phone: {2} | Email: {3}"
// -> Example: "Lisa Sommer | Phone:123 | Email: l.sommer@domain.local"
isFilterable
Type: Boolean
Default: true
Specifies, whether a field or filterextension is filterable. Filterable fields will be available for selection by a user.
isLookupFilter
Type: Boolean
Default: true
For a column of the lookup component, specifies whether to search for data in it. That is, if a term is entered in the lookup component, it searches for matches in all columns marked as isFilterable.