Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Артем Александров <vicreal(at)yandex(dot)ru>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
Date: 2022-04-25 21:47:46
Message-ID: CAKFQuwas8EKUo6UES25K7SWYuyk87RHmuj8aDgYvy_xPOyXshQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Apr 25, 2022 at 2:34 PM Артем Александров <vicreal(at)yandex(dot)ru> wrote:

> > Why are you writing the number 5 as "4|1" (4 "bitwise or" 1) in Test 3?
>
> According to the reference: "*The integer option controls several
> behaviors, so it is a bit mask: you can specify one or more behaviors using
> **|** (for example, **2|4**)*".
>
>

I was so surprised by the use of a bitmap here I didn't get that far, my
bad.

*The task is as follows*:
> *1)* use normalization option 4 (document rank is divided by the average
> harmonic distance between blocks)
> *2)* in test 3, get the result Y < X
>
>
You are first using normalization option 1 (divide rank by 1+ log(len))
Then, for option 4, divide that first result by "mean harmonic distance
between extents" - I have no idea how to do that off the top of my head...

"If more than one flag bit is specified, the transformations are applied in
the order listed."

The listed order is the documented order, not the order you specify. The
function has no way of to know whether the 5 it received was presented as
5, 1|4, or 4|1

We are open source if you want to demonstrate specifically, using numbers,
where the error in the calculation is and, ideally, where it happens in the
code. I don't know enough to say with the information given whether your
assertion of a bug is correct or a mis-understanding on your part.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-04-25 22:13:06 Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
Previous Message Артем Александров 2022-04-25 21:34:01 Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4