On 14.02.2017 18:57, Artur Zakirov wrote:
>
> Hello,
>
> try the query:
>
> SELECT s, ts_rank(vector, query) AS rank
> FROM t, to_tsvector(s) vector, to_tsquery('hello') query
> WHERE query @@ vector;
> s | rank
> -------------+-----------
> hello | 0.0607927
> hello world | 0.0303964
> (2 rows)
Sorry, the query is:
SELECT s, ts_rank(vector, query, 2) AS rank
FROM t, to_tsvector(s) vector, to_tsquery('hello') query
WHERE query @@ vector;
--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company