Consultor Eletrônico



Kbase 16469: Example of how to change word indexing rules (V7 + )
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Example of how to change word indexing rules (V7 + )

What follows is an example of how to change the rules which affect
the behavior of the CONTAINS clause when using a word index on a
database table.

For example, by default, PROGRESS word indexes ignore any
apostrophes, so "heres" and "here's" will both be returned if
your record phrase includes CONTAINS "heres" or CONTAINS "here's".

This example modifies the behavior so that an apostrophe (') is
made significant.

First, notice the contents of proword.def in your dlc subdirectory:
/*
*
* Progress Word Break Source File for English
*
*/

/* Special word break rules table */
word_attr =
{
'.', BEFORE_DIGIT,
/* part of a word only if followed by a digit */
',', BEFORE_DIGIT,
'-', BEFORE_DIGIT,
''', IGNORE, /* completely ignore it */
'$', USE_IT, /* always part of a word */
'%', USE_IT,
'#', USE_IT,
'@', USE_IT,
'_', USE_IT
};

1> Create a file to reverse the ''', IGNORE line as follows:

word_attr = { ''', USE_IT };

Save this file using a convenient filename, say, myword.def

2> Now, build this rule file into the word break compiler:
proutil <dbname> -C wbreak-compiler myword.def 1
The number at the end can be any value between 1 and 255.

This step generates a proword.1 file (the actual number will match
the number you specified in the proutil command line).

3> Move the generated rule file into your dlc directory, or define
an environment variable PROWD1 with the full file specification
(use your number as the last character(s) of the environment
variable name).

On UNIX, this would be done as follows:
PROWD1=proword.1;export PROWD1

4> Apply the new rules to your database:
proutil <dbname> -C word-rules 1
Again, the number must match the rule number you've specified in
the above steps.

5> If any active word indexes are affected by this rule change,
rebuild them:
proutil <dbname> -C idxbuild

References to written documentation:
PROGRESS Programming Handbook "Database Access" chapter,
section entitled "Word Delimiters"

Progress Software Technical Support Note # 16469