ALTER TEXT CONFIGURATION statement

Description

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
stoplist : string-expression
library-and-entry-point-name-string : [operating-system:]function-name@library

Examples

Example 1

These statements create 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

This statement adds stoplist terms to the maxTerm16 configuration object:

ALTER TEXT CONFIGURATION maxTerm16
STOPLIST 'because about therefore only';

Example 3

This example 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

This example 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

TEXT indexes are dependent on a text configuration object. Sybase 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

STOPLIST clause Use this clause 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. Stoplist terms 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 clause Use this clause to drop the stoplist for a text configuration object.

MINIMUM TERM LENGTH clause 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 clause With GENERIC TEXT indexes, 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 clause 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. Only the GENERIC term breaker is supported by Sybase IQ TEXT indexes. 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.

TERM BREAKER can include the specification for the external term breaker library using EXTERNAL NAME and the library entry point.

DROP PREFILTER clause Drops the external prefilter and sets NULL to the prefilter columns in ISYSTEXTCONFIG table.

PREFILTER EXTERNAL NAME clause Specifies the entry_point and the library name of the external pre-filter library provided by external vendors.


Side effects

Automatic commit.

Permissions

The user must have DBA authority to alter the text configuration object to specify the external libraries and functions for external pre-filter or term-breaker.

All other modifications to the text configuration can be done by either the owner of the configuration object or by a user having DBA authority.