Synonym Tool
Use the Synonym Tool to add a synonym dictionary to a collection to improve the quality of search results, or to remove synonyms from a collection.
You can use the Synonym Tool whenever the text search server is running. The text search server administrator has the correct authority and privileges to run the Synonym Tool.
A synonym
dictionary consists of synonym groups that you define in an XML file.
For example:
<?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>Commands
The command that you issue to run the Synonym Tool depends on whether the text search server is installed on a Linux®, Linux on IBM Z®, or Windows server.
| On a Linux or zLinux server | On a Windows server |
|---|---|
|
|
Global arguments
- -configPath
- Specifies the fully qualified path to the configuration directory, such as /opt/ibm/search/config. If this value contains blanks, you must enclose the value in quotation marks. This global argument is mandatory.
- -locale
- Specifies the five-character locale code, such as en_US for English or de_DE for German. The default value is en_US.
Command options
- importSynonym
- Adds a synonym dictionary to a collection, or updates the synonym
dictionary for a collection.
- -synonymFile
- Specifies the fully qualified path to the synonym file that contains the updated synonyms.
- -replace
- Specifies whether to replace the existing synonym file with the updated synonyms (true), or append the updated synonyms to the existing synonym file (false).
- -collectionName
- Specifies the name of the collection for which synonyms are to be updated.
- removeSynonym
- Deletes all of the synonyms for a collection.
- -collectionName
- Specifies the name of the collection for which synonyms are to be removed.
- help
- Prints the usage information for this tool.
Examples
Example
1: On a Linux server, use the following command to
append updated synonyms in the Default collection:
synonymTool.sh importSynonym
-synonymFile /fullpath/synonym.xml
-collectionName Default
-replace false
-configPath /opt/ibm/search/config
Example 2: On a Windows server,
use the following command to remove all synonyms from the Default
collection:
synonymTool.bat removeSynonym
-collectionName Default
-configPath c:\\Program Files\\IBM\\Search\\config