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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general