Feature Pack 2

Handling search term associations using the synonyms.txt file

Search term associations are stored and updated in the synonyms.txt file in Feature Pack 2.

The master data for search term associations is stored in the following WebSphere Commerce database tables:

The Search Term Association services are called to update the database tables when search term associations are updated in the Management Center. Then, the ProcessOnlineStorePublishSearchTermAssociationsActionCmdImpl command is called to update the synonyms.txt file for each corresponding master catalog (one synonym.txt file per language) with the synonyms and replacement terms. The Solr core is then reloaded so that the changes to the synonyms.txt files immediately take effect.

When synonyms and replacement terms are modified in a workspace environment, the synonyms.txt file is updated and the Solr core only reloaded after the workspace task is approved. If WebSphere Commerce search is deployed in a clustered environment, the WebSphere Commerce nodes make changes to the master search node, and then replicates the synonyms.txt file changes to all the subordinate search nodes. If the master search node is on a different machine, the WebSphere Commerce nodes must map to the master search node's drive to write to the synonyms.txt file.

The location of the Solr home directory is defined in the WebSphere Commerce instance configuration file so that the synonyms.txt file can be updated. Solr home is specified resembling the following snippet:

<SolrSearch solrHome="X:\WC/search/solr/home"/>

The Solr schema.xml file uses the SynonymFilterFactory property to expand the specified search terms by using the synonyms and replacement terms that are defined in the synonyms.txt file.