Synonym tool for Db2 Text Search
The synonym tool is a command-line tool that provides a convenient way to add synonym dictionaries to or remove synonym dictionaries from text search indexes.
synonymTool syntax
Parameters
-
importSynonym
- Adds the synonym dictionary specified by -synonymFile to the text search collection specified by -collectionName or to the language that is specified by the -language argument. -synonymFile absolute-path-to-syn-file
- Specifies the XML file that is to be used as a synonym dictionary. -language2-character language code
- Specifies the 2-character language code for which synonyms are defined. -replace
- true
Specifies that the synonyms in the file specified by -synonymFile are to replace the current synonyms of the existing synonym dictionary associated with the text search collection.
- false
Specifies that the synonyms in the file specified by -synonymFile are to be appended to the existing synonym dictionary associated with the text search collection.
removeSynonym
- true
- Removes any synonym dictionary from the text search collection specified by the collectionName argument. -collectionName collection-name
- Specifies the text search collection for which synonyms are defined. You can specify the full path to the collection. If you specify the collection name only, the default collection path ECMTS_HOME\config\collections is used. -configPath absolute-path-to-config-folder
- Specifies the absolute path to the text search configuration folder.
For the ECM Text Search server this path is <ECMTS_HOME>\configuration, which is the full path to the configuration folder containing the configuration.xml file.
locale
- Specifies a five character locale setting. The default value is en_US. help
- Prints the Synonym Tool command usage. The usage information is also printed if you run the Synonym Tool without a required argument.
Examples
- Create a synonym XML file by specifying synonym groups.
<?xml version="1.0" encoding="UTF-8"?> <synonymgroups version="1.0"> <synonymgroup> <synonym>Paixão</synonym> <synonym>amor</synonym> <synonym>flor/synonym> <synonym>linda</synonym> </synonymgroup> <synonymgroup> <synonym>worldwide patent tracking system</synonym> <synonym>wpts</synonym> </synonymgroup> </synonymgroups>
- Import new synonyms in a collection on a Linux® server.
Remove all synonyms from a collection that uses the French locale on a Windows server../synonymTool.sh importSynonym -configPath "$INSTHOME/sqllib/db2tss/config" -synonymFile synonym.xml -collectionName mycollection -replace false
synonymTool.bat removeSynonym -configPath "INSTPROFDIR%\instance-name\DB2TSS\CONFIG" -collectionName mycollection -locale fr_FR
Usage notes
The server must be running to use the synonym tool.
The XML file that is to be used as a synonym dictionary must be on the text search server.
The error or trace log is written to the commandLineTools0.log and error0.log files in the default log directory.
- On Linux or UNIX systems: synonymTool.sh
- On Windows systems: synonymTool.bat