Re: FTS uses "tsquery" directly in the query - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: FTS uses "tsquery" directly in the query
Date
Msg-id 20100125223327.78b33002@dawn.webthatworks.it
Whole thread Raw
In response to Re: FTS uses "tsquery" directly in the query  (Oleg Bartunov <oleg@sai.msu.su>)
Responses Re: FTS uses "tsquery" directly in the query
List pgsql-general
On Mon, 25 Jan 2010 23:35:12 +0300 (MSK)
Oleg Bartunov <oleg@sai.msu.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


pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: FTS uses "tsquery" directly in the query
Next
From: PG User 2010
Date:
Subject: Re: VACUUM FULL performance issues with pg_largeobject table