|
OMNIDEX |
Omnidex Text |
|
Synonym SearchesA Synonym search adds synonyms of the original search criteria keywords, obtained from either from a thesaurus or a managed synonym list, to a query's qualification criteria. Using the provided thesaurus based on the English language, a search for the keyword car would qualify not only rows containing the word car but also rows containing synonyms of car including auto, automobile, the phrase "motor vehicle", and others. And a search for sofa would also find couch, lounge, settee, etc... Similarly, using the provided managed synonym list "ALL_GIVEN_NAMES", a search for the name Jim would qualify not only rows containing the name Jim but also rows containing James, Jimmy, Jimmie, Jimbo, and others. All of the provided managed synonym lists can be modified and custom managed synonym lists can easily be added. This allows Chevrolet to be defined as a synonym to car and Lazy Boy as a synonym to chair, if the need arises. Performing a synonym search is almost exactly the same whether using the thesaurus or a managed synonym list. In either case, you use a $CONTAINS criteria predicate with the 'SYNONYMS' option in a SELECT statement, or the SYNONYMS function in a QUALIFY statement. If using a managed synonym list, you must indicate which list to use in the options parameter. If no list is specified, the thesaurus is used by default.
OptionsThe following options are for use with a thesaurus synonym search. LIST = list - Use this named list rather than using the list specified in the list parameter. PARTOFSPEECH=pos - Limit searches to the named part of speech when using the thesaurus or dictionary. pos can be NOUN, VERB, ADJECTIVE, ADVERB. SENSE=n - Limit searched to the specified sense when using the thesaurus or dictionary. Senses can be seen by looking up the definition of a word using the $LOOKUP function or using ODXSQL's LOOKUP command. MAX_SENSES=n | ALL - Limit searches to the specified number of senses when searching the thesaurus or dictionary. By default, searches are limited to the most common sense.
SYNONYMS FunctionThe Synonyms function is provided for use in an Omnidex QUALIFY statement and when QUALIFY syntax is used in a criteria predicate. $CONTAINS should be used otherwise. SyntaxSYNONYMS(criteria[, list[, options]]) criteria list options
ExamplesAll of the following statements will produce the same results. All require an MDK index. However, the first four require no additional setup. SELECT FIRST_NAME FROM CUSTOMERS WHERE $CONTAINS(FIRST_NAME,'fred,'SYNONYMS=ALL_GIVEN_NAMES') SELECT FIRST_NAME FROM CUSTOMERS WHERE $CONTAINS(FIRST_NAME,'fred,'SYNONYMS','LIST=ALL_GIVEN_NAMES') QUALIFY CUSTOMERS WHERE FIRST_NAME = 'SYNONYMS(fred,"ALL_GIVEN_NAMES")' QUALIFY CUSTOMERS WHERE FIRST_NAME = 'SYNONYMS(fred,,"LIST=ALL_GIVEN_NAMES")' SELECT FIRST_NAME FROM CUSTOMERS WHERE $CONTAINS(FIRST_NAME, '(SYNONYMS(fred,"ALL_GIVEN_NAMES"))') You can also define the synonyms option in the environment catalog. The following environment catalog column declaration will cause Omnidex to automatically use the "ALL_GIVEN_NAMES" managed synonym list, whenever synonyms are requested in the SQL statement. COLUMN FIRST_NAME DATATYPE CHAR(20) SYNONYMS 'LIST=ALL_GIVEN_NAMES' SELECT FIRST_NAME FROM CUSTOMERS WHERE $CONTAINS(FIRST_NAME,'fred,'SYNONYMS') The previous setup requires the application to request synonyms, while the default synonym list is pre-defined. To cause synonyms to be applied to all queries whether or not they request synonyms, add the AUTOENABLE option to the column declaration. COLUMN FIRST_NAME DATATYPE CHAR(20) SYNONYMS 'LIST=ALL_GIVEN_NAMES
AUTOENABLE' SELECT FIRST_NAME FROM CUSTOMERS WHERE FIRST_NAME='FRED'
|
|
Environment Catalog | Database Integration | Omnidex Text | Other Features |
Environment |
Database |
Table |
Column |
Rule |
Index |
Message |
SQL Server |
Oracle |
DB2 |
Flat Files |
External Documents |
Configuration |
Keyword Searches |
Synonym Searches |
Proximity Searches |
Form Searches |
Misspelling Searches |
Spell Check Searches |
Phonetic Searches |
Exporting Data |
Pseudo-columns |
Partitioning |