Postgresql 中文操作指南

CREATE TEXT SEARCH PARSER

创建文本搜索解析器——定义新的文本搜索解析器

CREATE TEXT SEARCH PARSER — define a new text search parser

Synopsis

CREATE TEXT SEARCH PARSER name (
    START = start_function ,
    GETTOKEN = gettoken_function ,
    END = end_function ,
    LEXTYPES = lextypes_function
    [, HEADLINE = headline_function ]
)

Description

CREATE TEXT SEARCH PARSER 创建一个新的文本搜索解析器。文本搜索解析器定义将文本字符串拆分为标记并为这些标记分配类型(类别)的方法。解析器本身不是特别有用,但必须和一些用于搜索的文本搜索词典一同绑定到文本搜索配置中。

CREATE TEXT SEARCH PARSER creates a new text search parser. A text search parser defines a method for splitting a text string into tokens and assigning types (categories) to the tokens. A parser is not particularly useful by itself, but must be bound into a text search configuration along with some text search dictionaries to be used for searching.

如果给出了架构名称,那么文本搜索解析器将在指定的架构中创建。否则,它将在当前架构中创建。

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

您必须是超级用户才能使用 CREATE TEXT SEARCH PARSER 。(之所以做出这一限制,是因为错误的文本搜索解析器定义可能混淆甚至导致服务器崩溃。)

You must be a superuser to use CREATE TEXT SEARCH PARSER. (This restriction is made because an erroneous text search parser definition could confuse or even crash the server.)

详情请参考 Chapter 12

Refer to Chapter 12 for further information.

Parameters

  • name

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

  • start_function

    • The name of the start function for the parser.

  • gettoken_function

    • The name of the get-next-token function for the parser.

  • end_function

    • The name of the end function for the parser.

  • lextypes_function

    • The name of the lextypes function for the parser (a function that returns information about the set of token types it produces).

  • headline_function

    • The name of the headline function for the parser (a function that summarizes a set of tokens).

必要时,函数名称可以按架构限定。未指定参数类型,因为每种类型函数的参数列表都是预先确定的。除了标题函数之外,所有函数都是必需的。

The function names can be schema-qualified if necessary. Argument types are not given, since the argument list for each type of function is predetermined. All except the headline function are required.

这些参数可以按任何顺序显示,而不只是上面显示的顺序。

The arguments can appear in any order, not only the one shown above.

Compatibility

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

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