Make LC_COLLATE and LC_CTYPE database-level settings. Collation and
[PostgreSQL.git] / doc / src / sgml / ref / create_tsparser.sgml
blobde05e506232b79b115688444f4ce09db24d59672
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-CREATETSPARSER">
7 <refmeta>
8 <refentrytitle id="sql-createtsparser-title">CREATE TEXT SEARCH PARSER</refentrytitle>
9 <refmiscinfo>SQL - Language Statements</refmiscinfo>
10 </refmeta>
12 <refnamediv>
13 <refname>CREATE TEXT SEARCH PARSER</refname>
14 <refpurpose>define a new text search parser</refpurpose>
15 </refnamediv>
17 <indexterm zone="sql-createtsparser">
18 <primary>CREATE TEXT SEARCH PARSER</primary>
19 </indexterm>
21 <refsynopsisdiv>
22 <synopsis>
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> ]
30 </synopsis>
31 </refsynopsisdiv>
33 <refsect1>
34 <title>Description</title>
36 <para>
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.
43 </para>
45 <para>
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.
48 </para>
50 <para>
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.)
54 </para>
56 <para>
57 Refer to <xref linkend="textsearch"> for further information.
58 </para>
59 </refsect1>
61 <refsect1>
62 <title>Parameters</title>
64 <variablelist>
65 <varlistentry>
66 <term><replaceable class="parameter">name</replaceable></term>
67 <listitem>
68 <para>
69 The name of the text search parser to be created. The name can be
70 schema-qualified.
71 </para>
72 </listitem>
73 </varlistentry>
75 <varlistentry>
76 <term><replaceable class="parameter">start_function</replaceable></term>
77 <listitem>
78 <para>
79 The name of the start function for the parser.
80 </para>
81 </listitem>
82 </varlistentry>
84 <varlistentry>
85 <term><replaceable class="parameter">gettoken_function</replaceable></term>
86 <listitem>
87 <para>
88 The name of the get-next-token function for the parser.
89 </para>
90 </listitem>
91 </varlistentry>
93 <varlistentry>
94 <term><replaceable class="parameter">end_function</replaceable></term>
95 <listitem>
96 <para>
97 The name of the end function for the parser.
98 </para>
99 </listitem>
100 </varlistentry>
102 <varlistentry>
103 <term><replaceable class="parameter">lextypes_function</replaceable></term>
104 <listitem>
105 <para>
106 The name of the lextypes function for the parser (a function that
107 returns information about the set of token types it produces).
108 </para>
109 </listitem>
110 </varlistentry>
112 <varlistentry>
113 <term><replaceable class="parameter">headline_function</replaceable></term>
114 <listitem>
115 <para>
116 The name of the headline function for the parser (a function that
117 summarizes a set of tokens).
118 </para>
119 </listitem>
120 </varlistentry>
121 </variablelist>
123 <para>
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.
127 </para>
129 <para>
130 The arguments can appear in any order, not only the one shown above.
131 </para>
132 </refsect1>
134 <refsect1>
135 <title>Compatibility</title>
137 <para>
138 There is no
139 <command>CREATE TEXT SEARCH PARSER</command> statement in the SQL
140 standard.
141 </para>
142 </refsect1>
144 <refsect1>
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>
150 </simplelist>
151 </refsect1>
152 </refentry>