|
Tutorials |
Omnidex Text |
||||||||||||||||||||||||||||||
5 - Reinstall & Rebuild the indexes
|
Adding a Custom Synonym ListIn this lesson, we will create a new managed synonym list in its own file, add it to the oaglobal environment to make it accessible to Omnidex applications, and test it with ODXSQL. The custom synonym list will be 10 basic colors associated with 75 varying shades.
Step 1 - Create the Empty FileCreate a new empty text file using your favorite text editor and save
it as colors.txt.
Step 2 - Create the Synonym ListEnter the following data, or cut and paste to save some typing, into the new file. If using a text editor, be sure that there is a single tab between each column, and a new line between each row. In this example, COLOR_MATCH, in the first column, is the unique synonym list name. The second column is the basic color. This is the keyword that will be passed to Omnidex in the query criteria. The last column is the list of synonyms for the keyword in column 2. When the keyword "YELLOW", for example, is passed in the query criteria, the criteria will be expanded to include all of the synonyms for YELLOW. The criteria will change from If using a text editor, cutting and pasting this text might cause each column of every row to appear on its own line. Be sure to fix any improper formatting before continuing.
Step 3 - Move the FileMove colors.txt to the synonyms directory to make it accessible to oaglobal. This directory is located in OMNIDEX_HOME/config/english/synonyms. Notice that this directory already contains several other files. These files are the managed synonym lists provided with the Omnidex software and the offset index file (ofx) that Omnidex uses in searches against these lists. It may be a good idea to keep a copy of the custom synonym list in a separate location, just in case.
Step 4 - Recompile oaglobalRecompile the Omnidex global environment file (oaglobal). oaglobal.src is the environment source file and is located in OMNIDEX_HOME/config, along with the compiled environment file (oaglobal.env), an index installation script (oaglobalin), and a use file to load the offset indexes (oagloballd). It is not
necessary and not recommended that any manual changes be made to any of
these files. > oacomp oaglobal A message will be displayed indicating the success or failure of the operation. If it fails, contact DISC Technical Support. Otherwise, continue with step 5.
Step 5 - Reinstall and Rebuild the Indexes for oaglobalReinstall and rebuild the indexes on the Omnidex global environment file.
The installation script is located in the directory indicated in step
4. > dbinstal < oaglobalin This may take a few seconds to complete. If it fails, contact DISC Technical Support. Otherwise, continue with step 6.
Step 6 - Load the OFXReload the offset index files by executing the use file (oagloballd)
in ODXSQL. This is required whenever using TDF data files. The use file
is located in the directory indicated in step 4. > odxsql -use=oagloballd This may take a few seconds to complete. If it fails, contact DISC Technical
Support. Otherwise, you are ready to test it out. > exit
Step 7 - Test the InstallationTest the installation. For this example, we're going to use ODXSQL to make sure the synonym list is accessible and returning correct results. There are a three easy ways to test this in ODXSQL.
First, change directories to the Omnidex installation of your choice. Make sure it has a column containing relevant data, specifically colors that are found in the synonym lists. This column must be installed with an MDK index. Run ODXSQL and connect to that environment. > odxsql omniproducts > Execute a select statement similar to the following: select productname from products where $contains(productname,'green','synonyms=color_match') The relevant part of this statement is the $contains criteria predicate where the synonyms=color_match option is passed.
The second way to test the synonym list is to select the synonyms from the synonym list without touching the data. This is accomplished by selecting $lookup from the $omnidex table while connected to any Omnidex environment, as shown. > odxsql omniproducts > Set the display to show multiple lines so the entire result is displayed. > set multiline on Execute a select statement similar to the following: select $lookup(products.productname, 'red', 'synonyms=color_match') from $omnidex $lookup has the same signature as $contains, except $lookup does not support a label (optional in $contains). A table qualified column is required, although it can be any column, since it will only be used for the output. The value returned is the altered criteria predicate that would be used if a $contains criteria predicate were used. Notice that quoted phrases in the synonym list are displayed as two words "ANDED" together, as in HOT AND PINK.
> odxsql omniproducts > Turn on the explain plan for the Omnidex Text feature. This is done with the set option explain text. > set explain text Execute a select statement preceded by the explain command: > explain select productname from products where $contains(productname, 'purple', 'synonyms=color_match') Omnidex executes the select statement but returns a formatted explain plan instead of the selected rows. If the installation was successful and the tests worked, your custom synonym list is available to all local Omnidex installations.
|
||||||||||||||||||||||||||||||
|
Tutorials | Text | Programming | Utilities | Basics |
Auto Enable a Synonym List |
Add a New Synonym List |
Modify a Synonym List |
Setup & Install ODXAIM |
Install ODXAIM as a Windows Service |