Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Tutorials

Omnidex Text

1 - Open and Change the Environment Source File

2 - Compile the Environment File and Reinstall the Indexes

3 - Test the Changes

 

Synonym Searches

Omnidex Text

 

Tutorials

 

Automatically Use a Synonym List

In this lesson, we will modify an Omnidex environment file to force queries against the contact name column to always include synonyms of the name in the criteria. This is accomplished by adding a synonyms option to the column definition.

 

 

Step 1 - Open the Environment Source File

We will use the orders sample database for this example. The source file can be opened and edited with any text editor. Open the file and locate the Customers table, then locate the Contact column. Change the column definition, as follows:

COLUMN "CONTACT" PHYSICAL "CONTACT" DATATYPE C STRING(24)
SYNONYMS 'LIST=ALL_GIVEN_NAMES AUTOENABLE'

This example instructs Omnidex as to which synonym list to use when a synonym search is performed. The AUTOENABLE option causes a synonym search to always be performed when criteria is applied to this column.

Save the changes.

 

Step 2 - Recompile the Source File and Reinstall the Indexes

For the changes to take effect, you must recompile the source file and reinstall the indexes.

> oacomp orders

...

> dbinstal < orders.in

...

 

 

Step 3 - Test the Changes

For this example, we're going to use ODXSQL to make sure the synonym list is automatically used.

 

Run ODXSQL and connect to the environment.

odxsql orders
Connected to C:\DOCSAMPLES\orders\ssv\orders.env

>

Execute a select statement using criteria against the contact column. Use a normal column='criteria' predicate.

select contact from customers where contact='kathy'

This query returns all customers with the contact name Kathy, Kathleen, Cathy and Catherine. Synonyms of Kathy were automatically added to the criteria list.

 

Top