Re: turning a tsvector without position in a weighted tsvector - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: turning a tsvector without position in a weighted tsvector
Date
Msg-id 20100209000505.4bf69107@dawn.webthatworks.it
Whole thread Raw
In response to Re: turning a tsvector without position in a weighted tsvector  (Oleg Bartunov <oleg@sai.msu.su>)
Responses border case ::tsvector vs. to_tsvector was turning a tsvector without position in a weighted tsvector  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-general
On Mon, 8 Feb 2010 23:01:45 +0300 (MSK)
Oleg Bartunov <oleg@sai.msu.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


pgsql-general by date:

Previous
From: Michael van der Kolff
Date:
Subject: WINDOW functions - proposed addition weight (dp) for percent_rank, cume_dist
Next
From: "Wang, Mary Y"
Date:
Subject: How do I delete duplicate rows in a table?