Postgresql 中文操作指南

CREATE TEXT SEARCH DICTIONARY

CREATE TEXT SEARCH DICTIONARY — 定义新的文本搜索词典

CREATE TEXT SEARCH DICTIONARY — define a new text search dictionary

Synopsis

CREATE TEXT SEARCH DICTIONARY name (
    TEMPLATE = template
    [, option = value [, ... ]]
)

Description

CREATE TEXT SEARCH DICTIONARY 创建新的文本搜索词典。文本搜索词典指定用于识别搜索时相关或不相关的单词的方法。词典依赖于文本搜索模板,它指定实际执行工作的函数。通常词典会提供一些选项,用于控制模板函数的详细行为。

CREATE TEXT SEARCH DICTIONARY creates a new text search dictionary. A text search dictionary specifies a way of recognizing interesting or uninteresting words for searching. A dictionary depends on a text search template, which specifies the functions that actually perform the work. Typically the dictionary provides some options that control the detailed behavior of the template’s functions.

如果给出了架构名称,则文本搜索词典会在指定架构中创建。否则,则会在当前架构中创建。

If a schema name is given then the text search dictionary is created in the specified schema. Otherwise it is created in the current schema.

定义文本搜索词典的用户会成为其所有者。

The user who defines a text search dictionary becomes its owner.

详情请参考 Chapter 12

Refer to Chapter 12 for further information.

Parameters

  • name

    • The name of the text search dictionary to be created. The name can be schema-qualified.

  • template

    • The name of the text search template that will define the basic behavior of this dictionary.

  • option

    • The name of a template-specific option to be set for this dictionary.

  • value

    • The value to use for a template-specific option. If the value is not a simple identifier or number, it must be quoted (but you can always quote it, if you wish).

选项可以按任何顺序显示。

The options can appear in any order.

Examples

以下示例命令创建一个基于 Snowball 的词典,其中包含非标准的停用词列表。

The following example command creates a Snowball-based dictionary with a nonstandard list of stop words.

CREATE TEXT SEARCH DICTIONARY my_russian (
    template = snowball,
    language = russian,
    stopwords = myrussian
);

Compatibility

SQL 标准中没有 CREATE TEXT SEARCH DICTIONARY 语句。

There is no CREATE TEXT SEARCH DICTIONARY statement in the SQL standard.