Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group