3
PostgreSQL documentation
6
<refentry id="SQL-CREATETSPARSER">
8
<refentrytitle id="sql-createtsparser-title">CREATE TEXT SEARCH PARSER</refentrytitle>
9
<manvolnum>7</manvolnum>
10
<refmiscinfo>SQL - Language Statements</refmiscinfo>
14
<refname>CREATE TEXT SEARCH PARSER</refname>
15
<refpurpose>define a new text search parser</refpurpose>
18
<indexterm zone="sql-createtsparser">
19
<primary>CREATE TEXT SEARCH PARSER</primary>
24
CREATE TEXT SEARCH PARSER <replaceable class="parameter">name</replaceable> (
25
START = <replaceable class="parameter">start_function</replaceable> ,
26
GETTOKEN = <replaceable class="parameter">gettoken_function</replaceable> ,
27
END = <replaceable class="parameter">end_function</replaceable> ,
28
LEXTYPES = <replaceable class="parameter">lextypes_function</replaceable>
29
[, HEADLINE = <replaceable class="parameter">headline_function</replaceable> ]
35
<title>Description</title>
38
<command>CREATE TEXT SEARCH PARSER</command> creates a new text search
39
parser. A text search parser defines a method for splitting a text
40
string into tokens and assigning types (categories) to the tokens.
41
A parser is not particularly useful by itself, but must be bound into a
42
text search configuration along with some text search dictionaries
43
to be used for searching.
47
If a schema name is given then the text search parser is created in the
48
specified schema. Otherwise it is created in the current schema.
52
You must be a superuser to use <command>CREATE TEXT SEARCH PARSER</command>.
53
(This restriction is made because an erroneous text search parser
54
definition could confuse or even crash the server.)
58
Refer to <xref linkend="textsearch"> for further information.
63
<title>Parameters</title>
67
<term><replaceable class="parameter">name</replaceable></term>
70
The name of the text search parser to be created. The name can be
77
<term><replaceable class="parameter">start_function</replaceable></term>
80
The name of the start function for the parser.
86
<term><replaceable class="parameter">gettoken_function</replaceable></term>
89
The name of the get-next-token function for the parser.
95
<term><replaceable class="parameter">end_function</replaceable></term>
98
The name of the end function for the parser.
104
<term><replaceable class="parameter">lextypes_function</replaceable></term>
107
The name of the lextypes function for the parser (a function that
108
returns information about the set of token types it produces).
114
<term><replaceable class="parameter">headline_function</replaceable></term>
117
The name of the headline function for the parser (a function that
118
summarizes a set of tokens).
125
The function names can be schema-qualified if necessary. Argument types
126
are not given, since the argument list for each type of function is
127
predetermined. All except the headline function are required.
131
The arguments can appear in any order, not only the one shown above.
136
<title>Compatibility</title>
140
<command>CREATE TEXT SEARCH PARSER</command> statement in the SQL
146
<title>See Also</title>
148
<simplelist type="inline">
149
<member><xref linkend="sql-altertsparser" endterm="sql-altertsparser-title"></member>
150
<member><xref linkend="sql-droptsparser" endterm="sql-droptsparser-title"></member>