pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: vicreal@yandex.ru
Subject: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
Date: Mon, 25 Apr 2022 20:18:16 +0000
Message-ID: <17468-b485ab6d89ca8d84@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17468
Logged by:          vicreal
Email address:      vicreal@yandex.ru
PostgreSQL version: 13.1
Operating system:   Debian 10
Description:        

Test 1
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function | calculates'), 4); -- 0.1
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function'), 4);              -- 0.1

Test 2
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function | calculates'), 1); -- 0.124
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function'), 1);              -- 0.062

Test 3
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function | calculates'), 4|1); -- 0.062 (X)
SELECT ts_rank_cd(to_tsvector('This function calculates the coverage
density'), to_tsquery('function'), 4|1);              -- 0.062 (Y)

How it should be:
1) In test 3 rank Y should be smaller, than rank X (as in test 2).

2) How get difference ranks Y < X when using normalization variant 4 ?



view thread (5+ messages)  latest in thread

Message-ID: <17468-b485ab6d89ca8d84@postgresql.org>
Permalink:  ../17468-b485ab6d89ca8d84@postgresql.org/
Also on:    postgresql.org/message-id/17468-b485ab6d89ca8d84@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, vicreal@yandex.ru
  Subject: Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
  In-Reply-To: <17468-b485ab6d89ca8d84@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox