Indexing a new language in HCL Commerce Search

You can add a language to be indexed in HCL Commerce Search, so that the search utilities, storefront, and Management Center can recognize more required locales.

HCL Commerce provides templates and samples for the following locales and languages:
Translated languages
Language & Country or Region Identifier
English (United States) en_US
French (France) fr_FR
German (Germany) de_DE
Italian (Italy) it_IT
Spanish (Spain) es_ES
Portuguese (Brazil) pt_BR
Chinese-simplified (China) zh_CN
Chinese-traditional (Taiwan) zh_TW
Korean (Korea, South) ko_KR
Japanese (Japan) ja_JP
Russian (Russia) ru_RU
Romanian (Romania) ro_RO
Polish (Poland) pl_PL
To add these languages to a store:
  1. Add support for the language to a store using the Store Management tool in the Management Center.
  2. Complete the steps outlined in this task to add a new language to be indexed.
  3. Complete the What to do next tasks to index the new language.

If more languages are added and supported for your HCL Commerce instance, for example, Arabic (ar_EG), you must create the locale-specific assets accordingly.

Procedure

  1. Get your language ID. Run the SQL: select * command from LANGUAGE to see whether your required language is in the list. If it is not in this list, run the following SQL command to add a record for your new language like below
    insert into language values(your_langID, 'en_CA', 'en', 'CA', null, 'UTF-8', 'UTF-8', 1)
    Where your_langID is your language ID. Modify the other values according to your own needs.
  2. Update the SRCHCONF and SRCHCONFEXT tables to enable multi-language support for search index core. Run the following SQL command against SRCHCONF:
    update srchconf set languages='langID,your_langID' where indextype='CatalogGroup';
    update srchconf set languages='langID,your_langID' where indextype='CatalogEntry';
    Where:
    • langID is the existing language ID.
    • your_langID is your language ID.
    Run the following SQL command against the SRCHCONFEXT table to add your new language to specific search index cores:
    insert into srchconfext values(6, 'CatalogEntry', 10001, your_langID, 'Structured', '', 1); 
    insert into srchconfext values(7, 'CatalogEntry', 10001, your_langID, 'Unstructured', '', 1); 
    insert into srchconfext values(8, 'CatalogEntry', 10001, your_langID, 'WebContent', '', 1); 
    insert into srchconfext values(9, 'CatalogGroup', 10001, your_langID, 'Structured', '', 1); 
    Where:
    • The first column values 6-9 should be modified according to your existing SRCHCONFEXT_ID value.
  3. If the language is not listed in your wc-component.xml file, you can add it. In the file search_serverDIR\resources\search\runtime\config\com.ibm.commerce.search/wc-component.xml, look for the value "_config:valuemapping externalName="Locale" internalName="langId"". Check whether your language is in the list. If it is not the list, add your locale to the component configuration file on the Search EAR within the <_config:valuemappingservice> section of the file. The customization file is workspace_dir/search-config-ext/src/runtime/config/com.ibm.commerce.search/wc-component.xml. For example,
    <_config:valuemappingservice> 
            <_config:valuemapping externalName="Locale" internalName="langId"> 
            <_config:valuemap externalValue="en_CA" internalValue="-24"/> 
    </_config:valuemapping>
    </_config:valuemappingservice>
  4. Restart the search server to set up search cores for the new language.
  5. Build the index to build new language index data.
  6. See Limiting search terms and characters from the search query for information how customizing the stopwords.txt or protwords.txt files.