Alters a text configuration object.
Syntax
ALTER TEXT CONFIGURATION [ <owner>.]<config-name>
STOPLIST <stoplist>
| DROP STOPLIST
| { MINIMUM | MAXIMUM } TERM LENGTH <integer>
| TERM BREAKER
{ GENERIC
[ EXTERNAL NAME <library-and-entry-point-name-string> ]
| NGRAM }
| PREFILTER EXTERNAL NAME <library-and-entry-point-name-string>
| DROP PREFILTER
Parameters
(back to top)
- stoplist a string-expression used to create or replace
the list of terms to ignore when building a TEXT index. Terms specified in
this list are also ignored in a query. Separate stoplist terms with
spaces.
Stoplist terms cannot contain whitespace and
should not contain non-alphanumeric characters. Non-alphanumeric
characters are interpreted as spaces and break the term into multiple
terms. For example, “and/or” is interpreted as the two terms “and” and
“or”. The maximum number of stoplist terms is 7999.
- DROP STOPLIST use to drop the stoplist for a text
configuration object.
- MINIMUM TERM LENGTH specifies the minimum length, in characters, of
a term to include in the TEXT index. The value specified in the MINIMUM TERM
LENGTH clause is ignored when using NGRAM TEXT indexes.
Terms that are shorter than this setting are ignored when building or
refreshing the TEXT index. The value of this option must be greater than
0. If you set this option to be higher than MAXIMUM TERM LENGTH, the
value of MAXIMUM TERM LENGTH is automatically adjusted to be the same as
the new MINIMUM TERM LENGTH value.
- MAXIMUM TERM LENGTH with GENERIC TEXT indexes, specifies the
maximum length, in characters, of a term to include in the TEXT index. Terms
that are longer than this setting are ignored when building or refreshing
the TEXT index.
The value of MAXIMUM TERM LENGTH must be
less than or equal to 60. If you set this option to be lower than
MINIMUM TERM LENGTH, the value of MINIMUM TERM LENGTH is automatically
adjusted to be the same as the new MAXIMUM TERM LENGTH
value.
- TERM BREAKER specifies the name of the algorithm to use for
separating column values into terms. The choices for IN SYSTEM tables are
GENERIC (the default) or NGRAM. The GENERIC algorithm treats any string of
one or more alphanumerics, separated by non-alphanumerics, as a term.
The NGRAM algorithm breaks strings into n-grams. An
n-gram is an n-character substring of a larger string. The NGRAM term
breaker is required for fuzzy (approximate) matching, or for documents
that do not use whitespace or non-alphanumeric characters to separate
terms. NGRAM is supported for IN SYSTEM tables.
NGRAM term breaker is built on TEXT indexes, so use text configuration
object settings to define whether to use an NGRAM or GENERIC TEXT
index.
TERM BREAKER can include the specification
for the external term breaker library using EXTERNAL NAME and the
library entry point.
- library-and-entry-point-name-string <[operating-system:]function-name@library>
- PREFILTER EXTERNAL NAME specifies the entry_point and the library name
of the external pre-filter library provided by external
vendors.
- DROP PREFILTER drops the external prefilter and sets NULL to
the prefilter columns in ISYSTEXTCONFIG
table.
Examples
(back to top)
- Example 1 creates a text configuration object, maxTerm16, and then change the maximum term
length to 16:
CREATE TEXT CONFIGURATION maxTerm16 FROM default_char;
ALTER TEXT CONFIGURATION maxTerm16 MAXIMUM TERM LENGTH 16;
- Example 2 adds stoplist terms to the maxTerm16 configuration object:
ALTER TEXT CONFIGURATION maxTerm16
STOPLIST 'because about therefore only';
- Example 3 updates the text configuration object, my_text_config, to use the entry point my_term_breaker in the external library
mytermbreaker.dll for breaking the
text:
CREATE TEXT CONFIGURATION my_text_config FROM default_char;
ALTER TEXT CONFIGURATION my_text_config
TERM BREAKER GENERIC EXTERNAL NAME 'platform:my_term_breaker@mytermbreaker';
- Example 4 updates the text configuration object, my_text_config, to use the entry point my_prefilter in the external library myprefilter.dll for prefiltering the
documents:
ALTER TEXT CONFIGURATION my_text_config
PREFILTER EXTERNAL NAME 'platform:my_prefilter@myprefilter';
Usage
(back to
top)
TEXT indexes are dependent on a text configuration object.
SAP IQ TEXT indexes use immediate
refresh, and cannot be truncated; you must drop the indexes before you can alter the
text configuration object. To view the settings for text configuration objects, query
the
SYSTEXTCONFIG system view.
Permissions
(back to top)
TERM BREAKER or
PREFILTER
EXTERNAL NAME clause – Requires the CREATE ANY EXTERNAL REFERENCE
system privilege, along with one of:
- ALTER ANY TEXT CONFIGURATION system privilege.
- ALTER ANY OBJECT system privilege.
- You own the text configuration object.
All
other clauses – Requires the ALTER ANY TEXT CONFIGURATION system privilege,
regardless of whether the user is the owner of the configuration object.