summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/ref/create_tsconfig.sgml
blob: 390d3cfe51204a120830d33a3e4375f09502ee4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!--
doc/src/sgml/ref/create_tsconfig.sgml
PostgreSQL documentation
-->

<refentry id="sql-createtsconfig">
 <indexterm zone="sql-createtsconfig">
  <primary>CREATE TEXT SEARCH CONFIGURATION</primary>
 </indexterm>

 <refmeta>
  <refentrytitle>CREATE TEXT SEARCH CONFIGURATION</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE TEXT SEARCH CONFIGURATION</refname>
  <refpurpose>define a new text search configuration</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
<synopsis>
CREATE TEXT SEARCH CONFIGURATION <replaceable class="parameter">name</replaceable> (
    PARSER = <replaceable class="parameter">parser_name</replaceable> |
    COPY = <replaceable class="parameter">source_config</replaceable>
)
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>CREATE TEXT SEARCH CONFIGURATION</command> creates a new text
   search configuration.  A text search configuration specifies a text
   search parser that can divide a string into tokens, plus dictionaries
   that can be used to determine which tokens are of interest for searching.
  </para>

  <para>
   If only the parser is specified, then the new text search configuration
   initially has no mappings from token types to dictionaries, and therefore
   will ignore all words.  Subsequent <command>ALTER TEXT SEARCH
   CONFIGURATION</command> commands must be used to create mappings to
   make the configuration useful.  Alternatively, an existing text search
   configuration can be copied.
  </para>

  <para>
   If a schema name is given then the text search configuration is created in
   the specified schema.  Otherwise it is created in the current schema.
  </para>

  <para>
   The user who defines a text search configuration becomes its owner.
  </para>

  <para>
   Refer to <xref linkend="textsearch"/> for further information.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of the text search configuration to be created.  The name can be
      schema-qualified.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">parser_name</replaceable></term>
    <listitem>
     <para>
      The name of the text search parser to use for this configuration.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">source_config</replaceable></term>
    <listitem>
     <para>
      The name of an existing text search configuration to copy.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   The <literal>PARSER</literal> and <literal>COPY</literal> options are mutually
   exclusive, because when an existing configuration is copied, its
   parser selection is copied too.
  </para>

 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   There is no <command>CREATE TEXT SEARCH CONFIGURATION</command> statement
   in the SQL standard.
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-altertsconfig"/></member>
   <member><xref linkend="sql-droptsconfig"/></member>
  </simplelist>
 </refsect1>
</refentry>