Re: tsearch2 questions

From: Joshua N Pritikin <jpritikin(at)pobox(dot)com>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 questions
Date: 2007-07-04 08:21:31
Message-ID: 20070704082131.GK25916@always.joy.eth.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 04, 2007 at 10:59:46AM +0400, Oleg Bartunov wrote:
> On Wed, 4 Jul 2007, Joshua N Pritikin wrote:
> >1. What is the advantage of the tsearch2() trigger? Why can't I write my
> >own trigger which does approximately:
>
> no advantage, it's just an example.

Please mention that in the documentation:

tsearch2() trigger used to automatically update vector_column_name,
my_filter_name is the function name to preprocess text_column_name.
There are can be many functions and text columns specified in tsearch2()
trigger. The following rule used: function applied to all subsequent
text columns until next function occurs. Example, function dropatsymbol
replaces all entries of @ sign by space.

tsearch2() is an example. You are welcome to write your own trigger.

> >2. Is there a way to know in advance the maximum return value of the
> >rank function? I have lots of other information to include in the
> >goodness-of-match score besides the fulltext match rank so I would
> >prefer a tsearch2 rank score between 0 and 1. Do I need to write my own
> >rank function?
>
> 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.

Thanks.

--
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 08:40:11 Re: tsearch2 questions
Previous Message Dave Page 2007-07-04 07:41:20 Re: Stored Procedure: Copy table from; path = text variable