Loading a Custom Thesaurus and Issuing Thesaurus-Based Queries
You can build and load a custom thesaurus.
The advantage of this method is that you can modify the thesaurus after indexing.
The limitation of this method is that you must use thesaurus expansion operators in your query. Long queries can cause extra overhead in the thesaurus expansion and slow your query down.
To build a custom thesaurus:
-
Create your thesaurus. See “Defining Terms in a Thesaurus”.
-
Load the thesaurus with
ctxload. The following example imports a thesaurus namedtech_docfrom an import file namedtech_thesaurus.txt:
ctxload -thes -name tech_doc -file tech_thesaurus.txt
-
At the prompt, enter your user name and password. To ensure security, do not enter a password at the command line.
-
Use
THESoperators to query. For example, you can find all documents that contain XML and its synonyms as defined intech_doc:
'SYN(XML, tech_doc)'