Re: [GENERAL] Use full text to rank results higher if they are"closer hit" - Mailing list pgsql-general

From Artur Zakirov
Subject Re: [GENERAL] Use full text to rank results higher if they are"closer hit"
Date
Msg-id 624b44dc-f0c3-2d2a-e6b1-513ff37434ed@postgrespro.ru
Whole thread Raw
In response to Re: [GENERAL] Use full text to rank results higher if they are"closer hit"  (Artur Zakirov <a.zakirov@postgrespro.ru>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Artur Zakirov
Date:
Subject: Re: [GENERAL] Use full text to rank results higher if they are"closer hit"
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Use full text to rank results higher if they are"closer hit"