Postgresql 中文操作指南
CREATE TEXT SEARCH CONFIGURATION
CREATE TEXT SEARCH CONFIGURATION — 定义新的文本搜索配置
CREATE TEXT SEARCH CONFIGURATION — define a new text search configuration
Description
CREATE TEXT SEARCH CONFIGURATION 创建新的文本搜索配置。文本搜索配置指定一个文本搜索解析器,它可以将字符串分成标记,以及字典,可以用来确定哪些标记对于搜索而言是有用的。
CREATE TEXT SEARCH CONFIGURATION creates a new text search configuration. A text search configuration specifies a text search parser that can divide a string into tokens, plus dictionaries that can be used to determine which tokens are of interest for searching.
如果只指定了解析器,那么新的文本搜索配置最初没有标记类型到字典的映射,因此会忽略所有单词。必须使用后续的 ALTER TEXT SEARCH CONFIGURATION 命令来创建映射,以使配置有用。或者,可以复制现有文本搜索配置。
If only the parser is specified, then the new text search configuration initially has no mappings from token types to dictionaries, and therefore will ignore all words. Subsequent ALTER TEXT SEARCH CONFIGURATION commands must be used to create mappings to make the configuration useful. Alternatively, an existing text search configuration can be copied.
如果给出了架构名称,则会在指定的架构中创建文本搜索配置。否则,它将在当前架构中创建。
If a schema name is given then the text search configuration is created in the specified schema. Otherwise it is created in the current schema.
定义文本搜索配置的用户将成为此配置的所有者。
The user who defines a text search configuration becomes its owner.
详情请参考 Chapter 12 。
Refer to Chapter 12 for further information.
Parameters
-
name
-
The name of the text search configuration to be created. The name can be schema-qualified.
-
-
parser_name
-
The name of the text search parser to use for this configuration.
-
-
source_config
-
The name of an existing text search configuration to copy.
-
Notes
PARSER 和 COPY 选项互斥,因为当复制现有配置时,其解析器选择也将被复制。
The PARSER and COPY options are mutually exclusive, because when an existing configuration is copied, its parser selection is copied too.