Mapping custom locales in Elasticsearch to ensure IQ search indexing works
If you find that your search engine indexing is not able to index, you may need to map any custom language identifiers to standard two-letter language keys. Because IQ search uses a third-party search engine, Elasticsearch, you need to make changes to your Elasticsearch instance. This is for the case where you do the mapping later, that is, not at install time.
Before you begin
- the names of the custom language values that need to be mapped to standard two-letter language keys. (For example
Anglaisshould be mapped to theenkey.) - the URL of your Elasticsearch instance
- some Elasticsearch search engine parameters; specifically, the names of the indexes containing these mappings, and the name of the mapping. If you used the default
bootstrap.jsonat installation time, these names areudp-locale-to-languagefor the indexlocale-map-11-1for the mapping.
About this task
When the search engine indexes search strings, it uses two-letter language identifiers (say, fr for French) and five-character language-plus-locale identifiers (say, en-us for US English) to identify the language of the search string.
When a user publishes content from SDL Tridion Docs Content Manager, the content is tagged with a language code (one of the values listed for the Language list of values). Maybe that language code is one of the two-letter or five-character language identifiers used by Elasticsearch. But you may have also configured a custom language identifier in the Language list of values (for example, Anglais for English), and applied that custom identifier to some of your content. By default, Elasticsearch won't recognize such an identifier. This means that the content won't be indexed and can't be searched. To get around this issue, you must create a mapping from an Elasticsearch language identifier (say en-us) to one or more custom language identifiers (say Anglais and Inglese) .
If you use custom language identifier and therefore need to map them, configure these mappings at installation time if at all possible, before you actually start using the IQ indexing service. However, you may have to configure this mapping at a later time, and as long as you are careful about which elements you edit, you should be able to avoid data corruption. Specifically , do not change the key elements (representing the Elasticsearch language identifier); only change the mapped values (representing your custom language identifier or identifiers).