Re: tsearch2 questions

From: Joshua N Pritikin <jpritikin(at)pobox(dot)com>
To: hubert depesz lubaczewski <depesz(at)gmail(dot)com>
Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 questions
Date: 2007-07-04 09:02:03
Message-ID: 20070704090203.GL25916@always.joy.eth.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 04, 2007 at 10:40:11AM +0200, hubert depesz lubaczewski wrote:
> On 7/4/07, Joshua N Pritikin <jpritikin(at)pobox(dot)com> wrote:
> >Please mention that in the documentation:
>
> dont you think this is perfeclty clear?
>
> "If you want to do something specific with columns, you may write your very
> own trigger function using plpgsql or other procedural languages (but not
> SQL, unfortunately) and use it instead of tsearch2 trigger."

From where are you quoting? I was quoting from:

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch2-ref.html

> >what's about simple normalization formulae, like rank/(rank+1) ?
> >I think you are suggesting that I use the best rank as the denominator
> >for the rank column. Yes, I suppose that will work.
>
> actually oleg supposed not to use best rank, but just use the formula as
> given - rank/(rank+1) to get rank in range of 0 to 1.

OK, then what does the +1 mean in your formulae? Consider these results
from [1]. rank/(rank+1): 0.19/.1 = 1.9, .1/.1 = 1, etc. That doesn't
make sense. The reciprocal also doesn't make sense. So what does Oleg
mean? I was guessing that Oleg meant to divide the rank column by the
first rank, that is, by 0.19 so you would get 1, .52, .52, etc.

id | headline | rank
----+-------------------------------------------------------+------
3 | <b>crawling</b> over cobbles in a low <b>passage</b>. | 0.19
1 | <b>crawl</b> over cobbles leads inward to the west. | 0.1
4 | <b>passages</b> lead east, north, and south. | 0.1
5 | <b>crawl</b> slants up. | 0.1
7 | <b>passage</b> here is blocked by a recent cave-in. | 0.1

Am I being stupid?

[1] http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch2-guide.html

--
Make April 15 just another day, visit http://fairtax.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2007-07-04 09:08:21 Re: tsearch2 questions
Previous Message hubert depesz lubaczewski 2007-07-04 08:58:01 Re: Date for a week day of a month