-
+
Full Text Search
For example:
-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
and return them in order of their similarity to the
query.', to_tsquery('query & similarity'));
and return them in order of their <b>similarity</b> to the
<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
and return them in order of their similarity to the
query.',
example:
-SELECT id, ts_headline(body,q), rank
-FROM (SELECT id, body, q, ts_rank_cd(ti,q) AS rank
+SELECT id, ts_headline(body, q), rank
+FROM (SELECT id, body, q, ts_rank_cd(ti, q) AS rank
FROM apod, to_tsquery('stars') q
WHERE ti @@ q
ORDER BY rank DESC LIMIT 10) AS foo;