mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Text search documentation word improvements; move configuration section
to be more logical.
This commit is contained in:
parent
bb8f629c7a
commit
09c29cc57b
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.389 2007/08/29 20:37:14 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.390 2007/08/29 21:51:45 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="functions">
|
<chapter id="functions">
|
||||||
<title>Functions and Operators</title>
|
<title>Functions and Operators</title>
|
||||||
@ -7552,7 +7552,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
|
|||||||
|
|
||||||
|
|
||||||
<sect1 id="functions-textsearch">
|
<sect1 id="functions-textsearch">
|
||||||
<title>Full Text Search Operators and Functions</title>
|
<title>Full Text Search Functions and Operators</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This section outlines all the functions and operators that are available
|
This section outlines all the functions and operators that are available
|
||||||
|
@ -231,8 +231,8 @@ SELECT 'fat & cow'::tsquery @@ 'a fat cat sat on a mat and ate a fat rat'::t
|
|||||||
is equivalent to <literal>to_tsvector(x) @@ y</literal>.
|
is equivalent to <literal>to_tsvector(x) @@ y</literal>.
|
||||||
The form <type>text</type> <literal>@@</literal> <type>text</type>
|
The form <type>text</type> <literal>@@</literal> <type>text</type>
|
||||||
is equivalent to <literal>to_tsvector(x) @@ plainto_tsquery(y)</literal>.
|
is equivalent to <literal>to_tsvector(x) @@ plainto_tsquery(y)</literal>.
|
||||||
<xref linkend="functions-textsearch"> contains a full list of full text
|
<xref linkend="functions-textsearch"> contains a complete list of full text
|
||||||
search operators and functions.
|
search functions and operators.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2 id="textsearch-configurations">
|
<sect2 id="textsearch-configurations">
|
||||||
@ -250,13 +250,23 @@ SELECT 'fat & cow'::tsquery @@ 'a fat cat sat on a mat and ate a fat rat'::t
|
|||||||
This functionality is controlled by <emphasis>configurations</>.
|
This functionality is controlled by <emphasis>configurations</>.
|
||||||
Fortunately, <productname>PostgreSQL</> comes with predefined
|
Fortunately, <productname>PostgreSQL</> comes with predefined
|
||||||
configurations for many languages. (<application>psql</>'s <command>\dF</>
|
configurations for many languages. (<application>psql</>'s <command>\dF</>
|
||||||
shows all predefined configurations.) During installation an appropriate
|
shows all predefined configurations.)
|
||||||
configuration was selected and <xref
|
</para>
|
||||||
linkend="guc-default-text-search-config"> was set accordingly. If you
|
|
||||||
need to change it, see <xref linkend="textsearch-tables-multiconfig">.
|
<para>
|
||||||
|
During installation an appropriate configuration was selected and
|
||||||
|
<xref linkend="guc-default-text-search-config"> was set accordingly
|
||||||
|
in <filename>postgresql.conf</>. If you are using the same text search
|
||||||
|
configuration for the entire cluster you can use the value in
|
||||||
|
<filename>postgresql.conf</>. If using different configurations but
|
||||||
|
the same text search configuration for an entire database,
|
||||||
|
use <command>ALTER DATABASE ... SET</>. If not, you must set <xref
|
||||||
|
linkend="guc-default-text-search-config"> in each session. Many
|
||||||
|
functions also take an optional configuration name.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="textsearch-tables">
|
<sect1 id="textsearch-tables">
|
||||||
@ -1781,35 +1791,6 @@ SHOW default_text_search_config;
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2 id="textsearch-tables-multiconfig">
|
|
||||||
<title>Managing Multiple Configurations</title>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
If you are using the same text search configuration for the entire cluster
|
|
||||||
just set the value in <filename>postgresql.conf</>. If using a single
|
|
||||||
text search configuration for an entire database, use <command>ALTER
|
|
||||||
DATABASE ... SET</>.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
However, if you need to use several text search configurations in the same
|
|
||||||
database you must be careful to reference the proper text search
|
|
||||||
configuration. This can be done by either setting
|
|
||||||
<varname>default_text_search_config</> in each session or supplying the
|
|
||||||
configuration name in every function call, e.g. to_tsquery('french',
|
|
||||||
'friend'), to_tsvector('english', col). If you are using an expression
|
|
||||||
index you must embed the configuration name into the expression index, e.g.:
|
|
||||||
|
|
||||||
<programlisting>
|
|
||||||
CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('french', title || body));
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
And for an expression index, specify the configuration name in the
|
|
||||||
<literal>WHERE</> clause as well so the expression index will be used.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="textsearch-indexes">
|
<sect1 id="textsearch-indexes">
|
||||||
|
Loading…
Reference in New Issue
Block a user