Indexing a new language in Commerce Search
You can add a language to be indexed in Commerce Search, so that the search utilities, storefront, and Management Center can recognize more required locales.
Commerce+ provides templates and samples for the following locales and
languages:
To add these languages to a store:
| 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 |
- Add support for the language to a store using the Store Management tool in the Management Center.
- Complete the steps outlined in this task to add a new language to be indexed.
- Complete the What to do next tasks to index the new language.
If more languages are added and supported for your Commerce+ instance, for example,
Arabic (ar_EG), you must create the locale-specific assets accordingly.
Procedure
-
Get your language ID. Run the SQL: select * command from
LANGUAGEto 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
Where your_langID is your language ID. Modify the other values according to your own needs.insert into language values(your_langID, 'en_CA', 'en', 'CA', null, 'UTF-8', 'UTF-8', 1) -
Update the
SRCHCONFandSRCHCONFEXTtables to enable multi-language support for search index core. Run the following SQL command againstSRCHCONF: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 theSRCHCONFEXTtable to add your new language to specific search index cores:
Where: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);- The first column values 6-9 should be modified according to your existing
SRCHCONFEXT_IDvalue.
-
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> - Restart the search server to set up search cores for the new language.
- Build the index to build new language index data.
- See Limiting search terms and characters from the search query for information how customizing the stopwords.txt or protwords.txt files.