Re: Weird ranking results with ts_rank

From: Javier Ayres <jayres(at)sophilabs(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weird ranking results with ts_rank
Date: 2019-11-18 13:01:04
Message-ID: CAC1P-g3V61Cty3m+8mw-KxBbJxzR8U+TrH-wq4z+SC9ia2XC1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oh I see. I was working as if no match was the same as ts_rank=0.

Great advice. Thank you very much.

On Sat, Nov 16, 2019 at 2:22 PM Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:

> On Fri, Nov 15, 2019 at 1:31 AM Javier Ayres <jayres(at)sophilabs(dot)com> wrote:
>
>> Hi everybody.
>>
>> I'm implementing a solution that uses PostgreSQL's full text search
>> capabilities and I have come across a particular set of results for ts_rank
>> that don't seem to make sense according to the documentation.
>>
>
> While the documentation doesn't come out and say, my interpretation is
> that ts_rank assumes there is a match in the first place, and by
> implication is undefined/unspecified if there is no match.
>
> select to_tsvector('search for a text box') @@ to_tsquery('circle | lot
> <-> box');
> ?column?
> ----------
> f
> (1 row)
>
> Cheers,
>
> Jeff
>

--
Javier Ayres
Data Engineer
+1 855 636 5811 <+18556365811> - sophilabs.co

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shatamjeev Dewan 2019-11-18 17:10:43 ERROR: there is no unique constraint matching given keys for referenced table "audit_p"
Previous Message Geoff Winkless 2019-11-18 12:24:40 Re: REINDEX VERBOSE unknown option