This is an old revision of the document!


Administration: Omnidex Indexing

PowerSearch

The SQL Behind PowerSearch

The POWERSEARCH Option

In most scenarios, the key to implementing PowerSearch is to simply use the POWERSEARCH option on a SELECT statement. Alternatively, the SET POWERSEARCH ON command can be used to automatically activate PowerSearch for all queries on that connection.

> select name from individuals where name = 'William Cooke' with powersearch;

NAME
--------------------------------------------------
BILLIE E COOK
MR. WILL COOK

The POWERSEARCH option works hand-in-hand with the data stored in the Omnidex Environment File. To use POWERSEARCH, administrators add a context to columns telling Omnidex what they contain. For example, a column named NAME may have a character datatype, but that alone is not enough to tell Omnidex what the column contains. Moreover, Omnidex cannot look to the column name, as there are many different conventions for naming columns. Administrators add a USAGE clause that identifies the contents as given names, as shown in this example:

create table          "HOUSEHOLDS"
 physical             "dat\households.dat"
 (
  "HOUSEHOLD"         CHARACTER(12)     omnidex,
  "ADDRESS"           CHARACTER(50)     quicktext   usage "STREET_ADDRESS",
  "CITY"              CHARACTER(28)     quicktext   usage "CITY",
  "STATE"             CHARACTER(2)      omnidex     usage "STATE",
  "ZIP"               CHARACTER(5)      omnidex     usage "ZIPCODE",
  "COUNTRY"           CHARACTER(2)      omnidex     usage "COUNTRY",
  constraint HOUSEHOLDS_HOUSEHOLD_PK primary ("HOUSEHOLD"),
  constraint HOUSEHOLDS_STATE_FK foreign ("STATE") references "STATES",
  constraint HOUSEHOLDS_COUNTRY_FK foreign ("COUNTRY") references "COUNTRIES"
 )
 in                   "simple.xml";


create table          "INDIVIDUALS"
 physical             "dat\individuals.dat"
 (
  "INDIVIDUAL"        CHARACTER(12)     omnidex,
  "HOUSEHOLD"         CHARACTER(12)     omnidex ,
  "NAME"              CHARACTER(50)     quicktext   usage "NAME",
  "GENDER"            CHARACTER(1)      omnidex bitmap,
  "BIRTHDATE"         ANSI DATE         omnidex,
  "PHONE"             CHARACTER(14)     omnidex     usage "PHONE",
  "EMAIL"             CHARACTER(60)     quicktext   usage "EMAIL",
  constraint INDIVIDUALS_INDIVIDUAL_PK primary ("INDIVIDUAL"),
  constraint INDIVIDUALS_HOUSEHOLD_FK foreign ("HOUSEHOLD") references "HOUSEHOLDS",
  constraint INDIVIDUALS_GENDER_FK foreign ("GENDER") references "GENDERS",
 )
 in                   "simple.xml";

Omnidex provides many different usages to meet the general needs of most applications; however, administrators can add custom usages to meet the specific needs of their application. The general usages provided by Omnidex include:

  • SALUTATION
  • FIRST_NAME
  • MIDDLE_NAME
  • LAST_NAME
  • NAME
  • COMPANY_NAME
  • STREET_NUMBER
  • STREET_DIRECTION
  • STREET_NAME
  • STREET_TYPE
  • UNIT_TYPE
  • UNIT_NUMBER
  • CITY
  • STATE
  • COUNTRY
  • ZIPCODE
  • STREET_ADDRESS
  • CITY_STATE_POSTAL
  • ADDRESS
  • PHONE_AREACODE
  • PHONE_PREFIX
  • PHONE_SUFFIX
  • PHONE
  • EMAIL

Additional Resources

See also:

 
Back to top
admin/indexing/powersearch/sql.1327949961.txt.gz ยท Last modified: 2016/06/28 22:38 (external edit)