3 PostgreSQL documentation
6 <refentry id=
"SQL-CREATETSPARSER">
8 <refentrytitle id=
"sql-createtsparser-title">CREATE TEXT SEARCH PARSER
</refentrytitle>
9 <refmiscinfo>SQL - Language Statements
</refmiscinfo>
13 <refname>CREATE TEXT SEARCH PARSER
</refname>
14 <refpurpose>define a new text search parser
</refpurpose>
17 <indexterm zone=
"sql-createtsparser">
18 <primary>CREATE TEXT SEARCH PARSER
</primary>
23 CREATE TEXT SEARCH PARSER
<replaceable class=
"parameter">name
</replaceable> (
24 START =
<replaceable class=
"parameter">start_function
</replaceable> ,
25 GETTOKEN =
<replaceable class=
"parameter">gettoken_function
</replaceable> ,
26 END =
<replaceable class=
"parameter">end_function
</replaceable> ,
27 LEXTYPES =
<replaceable class=
"parameter">lextypes_function
</replaceable>
28 [, HEADLINE =
<replaceable class=
"parameter">headline_function
</replaceable> ]
34 <title>Description
</title>
37 <command>CREATE TEXT SEARCH PARSER
</command> creates a new text search
38 parser. A text search parser defines a method for splitting a text
39 string into tokens and assigning types (categories) to the tokens.
40 A parser is not particularly useful by itself, but must be bound into a
41 text search configuration along with some text search dictionaries
42 to be used for searching.
46 If a schema name is given then the text search parser is created in the
47 specified schema. Otherwise it is created in the current schema.
51 You must be a superuser to use
<command>CREATE TEXT SEARCH PARSER
</command>.
52 (This restriction is made because an erroneous text search parser
53 definition could confuse or even crash the server.)
57 Refer to
<xref linkend=
"textsearch"> for further information.
62 <title>Parameters
</title>
66 <term><replaceable class=
"parameter">name
</replaceable></term>
69 The name of the text search parser to be created. The name can be
76 <term><replaceable class=
"parameter">start_function
</replaceable></term>
79 The name of the start function for the parser.
85 <term><replaceable class=
"parameter">gettoken_function
</replaceable></term>
88 The name of the get-next-token function for the parser.
94 <term><replaceable class=
"parameter">end_function
</replaceable></term>
97 The name of the end function for the parser.
103 <term><replaceable class=
"parameter">lextypes_function
</replaceable></term>
106 The name of the lextypes function for the parser (a function that
107 returns information about the set of token types it produces).
113 <term><replaceable class=
"parameter">headline_function
</replaceable></term>
116 The name of the headline function for the parser (a function that
117 summarizes a set of tokens).
124 The function names can be schema-qualified if necessary. Argument types
125 are not given, since the argument list for each type of function is
126 predetermined. All except the headline function are required.
130 The arguments can appear in any order, not only the one shown above.
135 <title>Compatibility
</title>
139 <command>CREATE TEXT SEARCH PARSER
</command> statement in the SQL
145 <title>See Also
</title>
147 <simplelist type=
"inline">
148 <member><xref linkend=
"sql-altertsparser" endterm=
"sql-altertsparser-title"></member>
149 <member><xref linkend=
"sql-droptsparser" endterm=
"sql-droptsparser-title"></member>