
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 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.
<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.