Re: turning a tsvector without position in a weighted tsvector

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: turning a tsvector without position in a weighted tsvector
Date: 2010-02-08 23:05:05
Message-ID: 20100209000505.4bf69107@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 8 Feb 2010 23:01:45 +0300 (MSK)
Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:

> Ivan,
>
> what's wrong with:
>
> postgres=# select 'abc:1'::tsvector;
> tsvector
> ----------
> 'abc':1

Yes you're right. I think I misplaced some quotes.
But still, once a vector has no position, I can't add the weights.

test=# select setweight('tano'::tsvector, 'A');
setweight
-----------
'tano'
(1 row)

test=# select setweight('tano:1'::tsvector, 'A');
setweight
-----------
'tano':1A
(1 row)

Since I'm writing some helper to manipulate tsvectors I was
wondering if
a) there is any reasonable use case of adding weights to
vectors with no position
b) I missed any obvious way to add weights to tsvectors that were
initially without positions

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wang, Mary Y 2010-02-08 23:32:51 How do I delete duplicate rows in a table?
Previous Message Bruce Momjian 2010-02-08 22:44:13 Re: Re: [GENERAL] FM format modifier does not remove leading zero from year