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

From: Артем Александров <vicreal(at)yandex(dot)ru>
To: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, 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:34:01
Message-ID: 277741650922104@mail.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<div><div><div>&gt; Why are you writing the number 5 as "4|1" (4 "bitwise or" 1) in Test 3?</div><div> </div></div><div>According to the reference: "<em>The integer option controls several behaviors, so it is a bit mask: you can specify one or more behaviors using </em><code><em>|</em></code><em> (for example, </em><code><em>2|4</em></code><em>)</em>".</div><div> </div><div><div><strong>The task is as follows</strong>:</div><div><strong>1)</strong> use normalization option 4 (document rank is divided by the average harmonic distance between blocks)</div><div><strong>2)</strong> in test 3, get the result Y &lt; X</div><div> </div><div>How to solve this problem ?</div></div><div> </div><div> </div></div><div> </div><div>26.04.2022, 00:18, "David G. Johnston" &lt;david(dot)g(dot)johnston(at)gmail(dot)com&gt;:</div><blockquote><div><div><div style="font-family:'arial' , 'helvetica' , sans-serif"><span style="font-family:'arial' , 'helvetica' , sans-serif">On Mon, Apr 25, 2022 at 2:03 PM PG Bug reporting form &lt;<a href="mailto:noreply(at)postgresql(dot)org" rel="noopener noreferrer">noreply(at)postgresql(dot)org</a>&gt; wrote:</span></div></div><div><blockquote style="border-left-color:rgb( 204 , 204 , 204 );border-left-style:solid;border-left-width:1px;margin:0px 0px 0px 0.8ex;padding-left:1ex">The following bug has been logged on the website:<br /><br />Bug reference:      17468<br />Logged by:          vicreal<br />Email address:      <a href="mailto:vicreal(at)yandex(dot)ru" rel="noopener noreferrer" target="_blank">vicreal(at)yandex(dot)ru</a><br />PostgreSQL version: 13.1<br />Operating system:   Debian 10<br />Description:       <br /> </blockquote><div> </div><blockquote style="border-left-color:rgb( 204 , 204 , 204 );border-left-style:solid;border-left-width:1px;margin:0px 0px 0px 0.8ex;padding-left:1ex">Test 3<br />SELECT ts_rank_cd(to_tsvector('This function calculates the coverage<br />density'), to_tsquery('function | calculates'), 4|1); -- 0.062 (X)<br />SELECT ts_rank_cd(to_tsvector('This function calculates the coverage<br />density'), to_tsquery('function'), 4|1);              -- 0.062 (Y)<br /><br />How it should be:<br />1) In test 3 rank Y should be smaller, than rank X (as in test 2).<br /><br />2) How get difference ranks Y &lt; X when using normalization variant 4 ?</blockquote><div> </div><div style="font-family:'arial' , 'helvetica' , sans-serif">Why are you writing the number 5 as "4|1" (4 "bitwise or" 1) in Test 3?</div><div style="font-family:'arial' , 'helvetica' , sans-serif"> </div><div style="font-family:'arial' , 'helvetica' , sans-serif">David J.</div><div style="font-family:'arial' , 'helvetica' , sans-serif"> </div></div></div></blockquote>

Attachment Content-Type Size
unknown_filename text/html 2.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-04-25 21:47:46 Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4
Previous Message David G. Johnston 2022-04-25 21:18:01 Re: BUG #17468: Ranking of search results: ts_rank_cd with normalization variant 4