Re: FTS uses "tsquery" directly in the query

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: FTS uses "tsquery" directly in the query
Date: 2010-01-25 21:33:27
Message-ID: 20100125223327.78b33002@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 25 Jan 2010 23:35:12 +0300 (MSK)
Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:

> Do you guys wanted something like:
>
> arxiv=# select and2or(to_tsquery('1 & 2 & 3'));
> and2or
> ---------------------
> ( '1' | '2' ) | '3'
> (1 row)

Nearly. I'm starting from a weighted tsvector not from text/tsquery.
I would like to:
- keep the weights in the query
- avoid parsing the text to extract lexemes twice (I already have a
tsvector)

For me extending pg in C is a new science, but I'm actually trying
to write at least a couple of functions that:
- will return a tsvector as a weight int, pos int[], lexeme text
record
- will turn a tsvector + operator into a tsquery
'orange':A1,2,3 'banana':B4,5 'tomato':C6,7 ->
'orange':A | 'banana':B | 'tomato':C
or eventually
'orange':A & 'banana':B & 'tomato':C

thanks

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message PG User 2010 2010-01-25 21:48:24 Re: VACUUM FULL performance issues with pg_largeobject table
Previous Message Oleg Bartunov 2010-01-25 20:35:12 Re: FTS uses "tsquery" directly in the query