Loading a Custom Thesaurus and Issuing Thesaurus-based Queries

You can build and load a custom thesaurus.

The advantage of using 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, follow these steps:

  1. Create your thesaurus. See "Defining Terms in a Thesaurus".
  2. Load thesaurus with ctxload. The following example imports a thesaurus named tech_doc from an import file named tech_thesaurus.txt:
    ctxload -thes -name tech_doc -file tech_thesaurus.txt 
    
  3. At the prompt, enter username and password. To ensure security, do not enter a password at the command line.
  4. Use THES operators to query. For example, you can find all documents that contain XML and its synonyms as defined in tech_doc:
    'SYN(XML, tech_doc)'