CREATE TEXT SEARCH TEMPLATE
CREATE TEXT SEARCH TEMPLATE — Define a new text search template
Synopsis
CREATE TEXT SEARCH TEMPLATE name (
[ INIT = init_function , ]
LEXIZE = lexize_function
)
Description
CREATE TEXT SEARCH TEMPLATE creates a new text search template. A text search template defines the functions that implement a text search dictionary. A template by itself is not useful, but must be instantiated as a dictionary to be used. The dictionary typically specifies parameters to pass to the template functions.
If a schema name is given, the text search template is created in the specified schema. Otherwise it is created in the current schema.
You must be a superuser to use CREATE TEXT SEARCH TEMPLATE. This restriction is made because an erroneous template definition could confuse or even crash the server. The reason for separating templates from dictionaries is that templates encapsulate the "unsafe" aspects of defining a dictionary. The parameters that can be set when defining a dictionary are safe for non-privileged users to set, so creating a dictionary does not require privilege to operate.
Parameters
name
The name of the text search template to be created. The name can be schema-qualified.
init_function
The name of the initialization function for the template.
lexize_function
The name of the lexize function for the template.
Function names can be schema-qualified if necessary. Parameter types are not given because the argument list for each type of function is predetermined. The lexize function is required, but the initialization function is optional.
Parameters can appear in any order, not just in the order shown above.