The etx_CreateSynWlst() routine

The etx_CreateSynWlst() routine creates a synonym list that the search engine uses to identify synonyms during a text search.

Syntax

etx_CreateSynWlst (list_name, file_name, sbspace)
Element Purpose Data type
list_name Name of your synonym list. If you enter a name longer than 18 characters, the name is silently truncated to 18 characters. CHAR (18)
file_name Absolute path name of the operating system file from which the text search engine loads the synonym list. The file can be on either the server or the client machine. The routine searches the client machine first. LVARCHAR
sbspace Optional parameter to specify the sbspace in which you want to store the synonym list. If you do not specify an sbspace, the database server stores the synonym list in the default sbspace. CHAR (18)

Return type

None.

Usage

Use the etx_CreateSynWlst() routine to store a synonym list in an sbspace.

A synonym list is a list of words that you want the search engine to treat as equal. For example, suppose you specify java as a synonym for the root word coffee in your synonym list. The search engine records a hit when it encounters the word java even though you specified the word coffee in your clue.

All words in a clue that are candidates for replacement by their synonyms must be listed as root words. For example, java is a synonym for the root word coffee. A synonym-matching search for the word coffee records a hit if the text search engine finds the word java. The reverse situation, in which a search for java records a hit if the search engine finds coffee, is only true if java is also listed as a root word, with coffee as one of its synonyms.

The format of the operating system file that contains the synonyms is one root word per line, followed by one or more synonyms, separated by blanks. The root word and its synonyms must all be on one line. Each line that contains text is to be followed by a blank line, as shown by the following example:
ABANDON RELINQUISH RESIGN QUIT SURRENDER 

ABILITY APTITUDE SKILL CAPABILITY TALENT 

SLANT SLOPE INCLINATION TILT LEANING 
The operating system file must not contain any proprietary formatting information and must consist only of characters made available to the index by the CHAR_SET index parameter when the index was created.
Important: Be sure to include an extra blank line between the lines of text in the operating system synonym file. If you omit the blank lines, the DataBlade® module does not return an error, but it never finds any synonyms during a synonym-matching search. Also be sure that all synonyms are spelled correctly.

The default synonym list

If you specify the MATCH_SYNONYM tuning parameter in the etx_contains() operator but do not set it equal to a value, etx_contains() refers to a default synonym list named etx_thesaurus. You can create your own etx_thesaurus synonym list from your own list of synonyms, or you can create one based on a list of standard English-language synonyms provided with your DataBlade module in the following location:
$ONEDB_HOME/extend/ETX.version/wordlist/etx_thesaurus.txt
where version is the current version of the DataBlade module installed on your computer.

If a query refers to the etx_thesaurus synonym list, and the list has not yet been created, the module returns an error.

After you create your list, use the etx_CreateSynWlst() procedure to store the etx_thesaurus list in an sbspace.

Example

The following statement creates a synonym list named my_synonym:
EXECUTE PROCEDURE etx_CreateSynWlst 
    ( 'my_synonym', '/local0/excal/syn_file', 'sbsp2');

The search engine stores and loads the contents of my_synonym from the operating system file /local0/excal/syn_file. The etx_CreateSynWlst() procedure stores the synonym list in an sbspace named sbsp2.