Skip to main content
Version: 1.0.16

ALTER TEXT SEARCH CONFIGURATION

ALTER TEXT SEARCH CONFIGURATION — Change the Definition of a Text Search Configuration

Synopsis

ALTER TEXT SEARCH CONFIGURATION name

ADD MAPPING FOR token_type [, ... ] WITH dictionary_name [, ... ]

ALTER TEXT SEARCH CONFIGURATION name

ALTER MAPPING FOR token_type [, ... ] WITH dictionary_name [, ... ]

ALTER TEXT SEARCH CONFIGURATION name

ALTER MAPPING REPLACE old_dictionary WITH new_dictionary

ALTER TEXT SEARCH CONFIGURATION name

ALTER MAPPING FOR token_type [, ... ] REPLACE old_dictionary

WITH new_dictionary

ALTER TEXT SEARCH CONFIGURATION name

DROP MAPPING [ IF EXISTS ] FOR token_type [, ... ]

ALTER TEXT SEARCH CONFIGURATION name RENAME TO new_name

ALTER TEXT SEARCH CONFIGURATION name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }

ALTER TEXT SEARCH CONFIGURATION name SET SCHEMA new_schema

Description

ALTER TEXT SEARCH CONFIGURATION changes the definition of a text search configuration. You can modify its token-type-to-dictionary mappings or change the name or owner of the configuration.

You must own the configuration to use ALTER TEXT SEARCH CONFIGURATION.

Parameters

name

The name (optionally schema-qualified) of an existing text search configuration.

token_type

The name of a token type produced by the configuration's parser.

dictionary_name

The name of a text search dictionary to consult for the specified token type(s). If multiple dictionaries are listed, they are consulted in the specified order.

old_dictionary

The name of a text search dictionary to replace in the mapping.

new_dictionary

The name of a text search dictionary to substitute for old_dictionary.

new_name

The new name of the text search configuration.

new_owner

The new owner of the text search configuration.

new_schema

The new schema for the text search configuration.

The ADD MAPPING FOR form installs dictionaries (listed by name) to consult for the specified token type(s). If there is already a mapping for any of the token types, an error occurs. The ALTER MAPPING FOR form does the same thing, but first drops any existing mappings for these token types. The ALTER MAPPING REPLACE form replaces old_dictionary with new_dictionary wherever it appears. When FOR is present, this is done only for the specified token type(s). If FOR is not present, it is done for all mappings in the configuration. The DROP MAPPING form removes all dictionaries for the specified token type(s), causing the text search configuration to ignore those types. Unless IF EXISTS appears, an error occurs if there is no mapping for any of the token types.

Examples

# The following example replaces the english dictionary with the swedish dictionary everywhere in my_config:

ALTER TEXT SEARCH CONFIGURATION my_config

ALTER MAPPING REPLACE english WITH swedish;

See Also

CREATE TEXT SEARCH CONFIGURATION, DROP TEXT SEARCH CONFIGURATION