pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: pgsql-docs@postgresql.org, Oleg Bartunov <oleg@sai.msu.su>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Subject: Re: Normalized Ranking example incorrect in text search
Date: Wed, 14 Nov 2007 14:49:26 -0500
Message-ID: <11985.1195069766@sss.pgh.pa.us> (raw)
In-Reply-To: <11802.1195069042@sss.pgh.pa.us>
References: <1195021491.4378.71.camel@ebony.site>
	<11802.1195069042@sss.pgh.pa.us>

I wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
>> and then gives a query which calculates normalization in an incorrect
>> manner,

> On what basis do you claim that's an incorrect manner?  It's exactly
> what is described in the paragraph just before the examples.

... although on reflection, it seems pretty stupid to be recommending
a method that requires two evaluations at each row of an admittedly
expensive function.

Seems like we should add one more normalization flag bit:

	32 --- replace computed rank by rank / (rank + 1)

and then the second example would be

SELECT title, ts_rank_cd(textsearch, query, 32 /* rank/(rank+1) */) AS rank
FROM apod, to_tsquery('neutrino|(dark & matter)') query
WHERE  query @@ textsearch
ORDER BY rank DESC LIMIT 10;

with no change in the example output.

			regards, tom lane



view thread (3+ messages)

Message-ID: <11985.1195069766@sss.pgh.pa.us>
Permalink:  ../11985.1195069766@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11985.1195069766@sss.pgh.pa.us

 · 

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-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, simon@2ndquadrant.com, oleg@sai.msu.su, teodor@sigaev.ru
  Subject: Re: Normalized Ranking example incorrect in text search
  In-Reply-To: <11985.1195069766@sss.pgh.pa.us>

* 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