|
Tutorials |
Omnidex Text |
|||||||||
3 - Reinstall & Rebuild the Indexes
|
Modify an Existing Synonym ListIn this lesson, we will modify an existing managed synonym list, recompile the oaglobal environment to make it accessible to Omnidex applications, and test it with ODXSQL. We are going to modify the STATE_CODES synonym list to include a few state "mottos". This will allow a user to enter a motto and find the corresponding state. While this is not a very practical example, it is sufficient to demonstrate how to modify a synonym list. If modifying a synonym list provided with the Omnidex software, it is advisable to keep a separate copy in a secure separate location. When reinstalling or upgrading Omnidex software, the contents of the default directories, including all the synonym lists, will be deleted and replaced with newer versions of the software.
Step 1 - Locate and Open the File Containing the Synonym ListSynonym lists are stored in the OMNIDEX_HOME/config/english/synonyms directory. Many of the files in this directory contain multiple lists, although the list we are going to modify for this lesson contains only one list. The file is states.txt. Open this file and locate the entry for CO. Change this entry to include the phrases "Colorful Colorado" and "Centennial State", and add a new entry, as follows:
Be sure to separate each column with a tab. Save the changed file.
Step 2 - 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 3.
Step 3 - 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
2. > dbinstal < oaglobalin This may take a few seconds to complete. If it fails, contact DISC Technical Support. Otherwise, continue with step 4.
Step 4 - 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 2. > 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 5 - 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.
First, change directories to the Omnidex installation of your choice. Make sure it has a column containing relevant data, states. This column must be installed with an MDK index. In this example, we will use the Order sample database. Run ODXSQL and connect to that environment. odxsql orders > Execute a select statement similar to the following: select city, state from customers where $contains(state,'centennial state','synonyms=state_codes') The relevant parts of this statement are the $contains criteria predicate where the synonyms=state_codes option is passed, and the keyword centennial state.
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. 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(customers.state, 'colorful colorado', 'synonyms=state_codes') 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.
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 city, state from customers where $contains(state,'centennial state','synonyms=state_codes') 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 |