Re: Weird ranking results with ts_rank

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Javier Ayres <jayres(at)sophilabs(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Weird ranking results with ts_rank
Date: 2019-11-16 17:22:40
Message-ID: CAMkU=1y-WoXp2e45Ai3mm_UtRkFuakgzUndYQeLbShbzMernaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josef Šimánek 2019-11-16 17:40:48 REINDEX VERBOSE unknown option
Previous Message Jeff Janes 2019-11-16 17:13:00 Re: PostGreSQL Replication and question on maintenance