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 creates a new text search parser. A text search parser defines a method for splitting text strings into tokens and assigning types (categories) to tokens. A parser by itself is not particularly useful, but it must be bound to a text search configuration along with some text search dictionaries to be used for searching.
If a schema name is given, the text search parser is created in the specified schema. Otherwise it is created in the current schema.
Only superusers can use CREATE TEXT SEARCH PARSER (this is because erroneous text search definitions could confuse or even crash the server).
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 lexer function (a function that returns information about the set of token types it produces) for the parser.
headline_function
The name of the headline function (a function that summarizes a set of tokens) for the parser.
Function names can be schema-qualified if necessary. Parameter types are not given because the argument list for each type of function is predetermined. All functions except the headline function are required.
Parameters can appear in any order, not necessarily in the order shown above.