mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Show example of ts_headline() using a configuration name.
This commit is contained in:
parent
d3567afffe
commit
f10cd72007
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.40 2007/12/13 06:32:47 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.40.2.1 2008/03/04 03:17:26 momjian Exp $ -->
|
||||||
|
|
||||||
<chapter id="textsearch">
|
<chapter id="textsearch">
|
||||||
<title id="textsearch-title">Full Text Search</title>
|
<title id="textsearch-title">Full Text Search</title>
|
||||||
@ -1102,7 +1102,7 @@ StartSel=<b>, StopSel=</b>, MaxWords=35, MinWords=15, ShortWord=3, H
|
|||||||
For example:
|
For example:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT ts_headline('The most common type of search
|
SELECT ts_headline('english', 'The most common type of search
|
||||||
is to find all documents containing given query terms
|
is to find all documents containing given query terms
|
||||||
and return them in order of their similarity to the
|
and return them in order of their similarity to the
|
||||||
query.', to_tsquery('query & similarity'));
|
query.', to_tsquery('query & similarity'));
|
||||||
@ -1112,7 +1112,7 @@ query.', to_tsquery('query & similarity'));
|
|||||||
and return them in order of their <b>similarity</b> to the
|
and return them in order of their <b>similarity</b> to the
|
||||||
<b>query</b>.
|
<b>query</b>.
|
||||||
|
|
||||||
SELECT ts_headline('The most common type of search
|
SELECT ts_headline('english', 'The most common type of search
|
||||||
is to find all documents containing given query terms
|
is to find all documents containing given query terms
|
||||||
and return them in order of their similarity to the
|
and return them in order of their similarity to the
|
||||||
query.',
|
query.',
|
||||||
@ -1135,8 +1135,8 @@ query.',
|
|||||||
example:
|
example:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT id, ts_headline(body,q), rank
|
SELECT id, ts_headline(body, q), rank
|
||||||
FROM (SELECT id, body, q, ts_rank_cd(ti,q) AS rank
|
FROM (SELECT id, body, q, ts_rank_cd(ti, q) AS rank
|
||||||
FROM apod, to_tsquery('stars') q
|
FROM apod, to_tsquery('stars') q
|
||||||
WHERE ti @@ q
|
WHERE ti @@ q
|
||||||
ORDER BY rank DESC LIMIT 10) AS foo;
|
ORDER BY rank DESC LIMIT 10) AS foo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user