mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
In text search docs, properly use indexterm _zone_ only when we want an
entire section, per Peter.
This commit is contained in:
parent
6e832b059e
commit
99a01bfd1e
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.208 2007/08/29 20:37:14 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.209 2007/08/31 04:52:29 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="datatype">
|
<chapter id="datatype">
|
||||||
<title id="datatype-title">Data Types</title>
|
<title id="datatype-title">Data Types</title>
|
||||||
@ -3281,20 +3281,18 @@ a0eebc999c0b4ef8bb6d6bb9bd380a11
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
|
|
||||||
<indexterm zone="datatype-textsearch">
|
|
||||||
<primary>tsvector</primary>
|
|
||||||
</indexterm>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><firstterm>tsvector</firstterm></term>
|
<term><firstterm>tsvector</firstterm></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<type>tsvector</type> is a data type that represents a document and is
|
<type>tsvector</type>
|
||||||
optimized for full text searching. In the simplest case,
|
<indexterm><primary>tsvector</primary></indexterm> is a data type
|
||||||
<type>tsvector</type> is a sorted list of lexemes, so even without indexes
|
that represents a document and is optimized for full text searching.
|
||||||
full text searches perform better than standard <literal>~</literal> and
|
In the simplest case, <type>tsvector</type> is a sorted list of
|
||||||
<literal>LIKE</literal> operations:
|
lexemes, so even without indexes full text searches perform better
|
||||||
|
than standard <literal>~</literal> and <literal>LIKE</literal>
|
||||||
|
operations:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector;
|
SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector;
|
||||||
@ -3355,19 +3353,17 @@ SELECT 'fat:1 rat:2'::tsvector || 'fat:1 cat:2'::tsvector;
|
|||||||
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<indexterm zone="datatype-textsearch">
|
|
||||||
<primary>tsquery</primary>
|
|
||||||
</indexterm>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><firstterm>tsquery</firstterm></term>
|
<term><firstterm>tsquery</firstterm></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<type>tsquery</type> is a data type for textual queries which supports
|
<type>tsquery</type>
|
||||||
the boolean operators <literal>&</literal> (AND), <literal>|</literal> (OR),
|
<indexterm><primary>tsquery</primary></indexterm> is a data type
|
||||||
and parentheses. A <type>tsquery</type> consists of lexemes
|
for textual queries which supports the boolean operators
|
||||||
(optionally labeled by letters) with boolean operators in between:
|
<literal>&</literal> (AND), <literal>|</literal> (OR), and
|
||||||
|
parentheses. A <type>tsquery</type> consists of lexemes (optionally
|
||||||
|
labeled by letters) with boolean operators in between:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT 'fat & cat'::tsquery;
|
SELECT 'fat & cat'::tsquery;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.390 2007/08/29 21:51:45 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.391 2007/08/31 04:52:29 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="functions">
|
<chapter id="functions">
|
||||||
<title>Functions and Operators</title>
|
<title>Functions and Operators</title>
|
||||||
@ -7585,7 +7585,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-search-operator">
|
<indexterm>
|
||||||
<primary>TSVECTOR @@ TSQUERY</primary>
|
<primary>TSVECTOR @@ TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7620,7 +7620,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector @@ 'fat & cow'::
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-search-operator">
|
<indexterm>
|
||||||
<primary>TEXT @@ TSQUERY</primary>
|
<primary>TEXT @@ TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7652,7 +7652,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat'::text @@ 'cat & cow'::tsqu
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-search-operator">
|
<indexterm>
|
||||||
<primary>TEXT @@ TEXT</primary>
|
<primary>TEXT @@ TEXT</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7701,7 +7701,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>to_tsvector</primary>
|
<primary>to_tsvector</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7723,7 +7723,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>strip</primary>
|
<primary>strip</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7746,7 +7746,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>setweight</primary>
|
<primary>setweight</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7771,7 +7771,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>tsvector concatenation</primary>
|
<primary>tsvector concatenation</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7802,7 +7802,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>length(tsvector)</primary>
|
<primary>length(tsvector)</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7821,7 +7821,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>text::tsvector</primary>
|
<primary>text::tsvector</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7846,7 +7846,7 @@ SELECT 'a fat cat sat on a mat and ate a fat rat' @@ 'cat cow';
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>trigger</primary>
|
<primary>trigger</primary>
|
||||||
<secondary>for updating a derived tsvector column</secondary>
|
<secondary>for updating a derived tsvector column</secondary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
@ -7896,7 +7896,7 @@ tsvector_update_trigger(tsv, 'pg_catalog.english', strMessage);
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>ts_stat</primary>
|
<primary>ts_stat</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7943,7 +7943,7 @@ LIMIT 10;
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsvector">
|
<indexterm>
|
||||||
<primary>Btree operations for tsvector</primary>
|
<primary>Btree operations for tsvector</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -7979,7 +7979,7 @@ LIMIT 10;
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>to_tsquery</primary>
|
<primary>to_tsquery</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8026,7 +8026,7 @@ SELECT to_tsquery('''supernovae stars'' & !crab');
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>plainto_tsquery</primary>
|
<primary>plainto_tsquery</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8051,7 +8051,7 @@ SELECT to_tsquery('''supernovae stars'' & !crab');
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>querytree</primary>
|
<primary>querytree</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8081,7 +8081,7 @@ SELECT querytree(to_tsquery('!defined'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>text::tsquery casting</primary>
|
<primary>text::tsquery casting</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8107,7 +8107,7 @@ SELECT querytree(to_tsquery('!defined'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>numnode</primary>
|
<primary>numnode</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8146,7 +8146,7 @@ SELECT numnode(plainto_tsquery('long table'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>TSQUERY && TSQUERY</primary>
|
<primary>TSQUERY && TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8165,7 +8165,7 @@ SELECT numnode(plainto_tsquery('long table'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>TSQUERY || TSQUERY</primary>
|
<primary>TSQUERY || TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8184,7 +8184,7 @@ SELECT numnode(plainto_tsquery('long table'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>!! TSQUERY</primary>
|
<primary>!! TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8203,7 +8203,7 @@ SELECT numnode(plainto_tsquery('long table'));
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>Btree operations for tsquery</primary>
|
<primary>Btree operations for tsquery</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8257,7 +8257,7 @@ INSERT INTO aliases VALUES('a', 'c');
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>ts_rewrite</primary>
|
<primary>ts_rewrite</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8404,7 +8404,7 @@ WHERE 'a & b' @> t;
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>TSQUERY @> TSQUERY</primary>
|
<primary>TSQUERY @> TSQUERY</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
@ -8423,7 +8423,7 @@ WHERE 'a & b' @> t;
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="functions-textsearch-tsquery">
|
<indexterm>
|
||||||
<primary>tsquery <@ tsquery</primary>
|
<primary>tsquery <@ tsquery</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
|
@ -429,6 +429,11 @@ ORDER BY rank DESC LIMIT 10;
|
|||||||
<sect2 id="textsearch-parser">
|
<sect2 id="textsearch-parser">
|
||||||
<title>Parsing</title>
|
<title>Parsing</title>
|
||||||
|
|
||||||
|
<indexterm zone="textsearch-parser">
|
||||||
|
<primary>text search</primary>
|
||||||
|
<secondary>parse</secondary>
|
||||||
|
</indexterm>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Full text searching in <productname>PostgreSQL</productname> provides
|
Full text searching in <productname>PostgreSQL</productname> provides
|
||||||
function <function>to_tsvector</function>, which converts a document to
|
function <function>to_tsvector</function>, which converts a document to
|
||||||
@ -544,11 +549,6 @@ UPDATE tt SET ti=
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
||||||
<indexterm zone="textsearch-parser">
|
|
||||||
<primary>text search</primary>
|
|
||||||
<secondary>parse</secondary>
|
|
||||||
</indexterm>
|
|
||||||
|
|
||||||
<term>
|
<term>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
ts_parse(<replaceable class="PARAMETER">parser</replaceable>, <replaceable class="PARAMETER">document</replaceable> TEXT) returns SETOF <type>tokenout</type>
|
ts_parse(<replaceable class="PARAMETER">parser</replaceable>, <replaceable class="PARAMETER">document</replaceable> TEXT) returns SETOF <type>tokenout</type>
|
||||||
|
Loading…
Reference in New Issue
Block a user