Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - SQL Reference » Using SQL » SQL statements » SQL statements (A-D)

 

ALTER TEXT CONFIGURATION statement

Alters a text configuration object.

Syntax
ALTER TEXT CONFIGURATION [ owner.]config-name
STOPLIST stoplist
| DROP STOPLIST
| { MINIMUM | MAXIMUM } TERM LENGTH integer
| TERM BREAKER { GENERIC | NGRAM }
stoplist : string-expression
Parameters
  • 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. For example, STOPLIST 'because about therefore only'. Stoplist terms cannot contain whitespace.

    Samples of stoplists for different languages are located in the samples-dir\SQLAnywhere\SQL subdirectory. For the location of samples-dir, see Samples directory.

    Stoplist terms should not contain non-alphanumeric characters.

    Carefully consider whether you want to put terms in your stoplist. For more information, see Text configuration object settings

  • DROP STOPLIST clause   Use this clause to drop the stoplist for a text configuration object.

  • MINIMUM TERM LENGTH clause   The value specified in the MINIMUM TERM LENGTH clause is ignored when using NGRAM text indexes.

    The minimum length, in characters, of a term to include in the text index. 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 NGRAM text indexes the value specified in the MAXIMUM TERM LENGTH clause is N.

    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 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. For more information about these algorithms and how to choose between them, see Text configuration object settings.

Remarks

Before changing the term length settings, read about the impact of various settings on what gets indexed and how query terms are interpreted. See Text configuration object settings, and Example text configuration objects.

Text indexes are dependent on a text configuration object. You must truncate dependent text indexes before altering the underlying text configuration object. If the dependent text indexes are of the immediate refresh type, and cannot be truncated, you must drop the indexes before you can alter the text configuration object.

To determine the text indexes that refer to a text configuration object, see View text indexes in the database.

To view the settings for text configuration objects, query the SYSTEXTCONFIG system view. See SYSTEXTCONFIG system view.

Permissions

Must be the owner of the text configuration object, or have DBA authority.

Side effects

Automatic commit

See also
Standards and compatibility
  • SQL/2003   Vendor extension.

Example

The following 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;

The following statement adds a stoplist to the maxTerm16 configuration object:

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