Adding a synonym dictionary for Db2 Text Search

You can easily add a synonym dictionary to a text search index by using the Synonym Tool.

Before you begin

  • You must activate the Db2 Text Search instance service before you can add a synonym dictionary to a text search index.
  • You must have updated the text search index at least once.
  • You must also have a synonym XML file that specifies synonym groups.

Procedure

To add a synonym dictionary:

  1. Copy the XML file to any directory on the Db2 Text Search server.
  2. Determine the name of the text search collection associated with the text search index to which you want to add the synonym dictionary. You can use the Administration Tool to report all text search collections, as follows:
    	adminTool status -configPath absolute-path-to-config-folder
  3. Use the Synonym Tool to add the synonym dictionary to the specific text search index. You can add the synonyms in append or replace mode, meaning that you either add them to or replace the existing synonyms defined for that text search index.
    synonymTool importSynonym -synonymFile absolute-path-to-syn-file 
    	-collectionName collection-name -replace true or false 
    	-configPath absolute-path-to-config-folder
    Note: If the XML format is not valid or if the XML file is empty, an error is returned.

Example

For example, to add the synonym file synfile.xml in append mode, use the following command:
	synonymTool importSynonym 
	-synonymFile $HOME/sqllib/misx/xmlsynfile.xml 
	-collectionName tigertail_DBCP1208_TS867530_0000 
	-replace false 
	-configPath $HOME/sqllib/db2tss/config