Re: [GENERAL] ranking how "similar" are tsvectors was: OR tsquery

2010-01-17 Thread Ivan Sergio Borgonovo
On Sun, 17 Jan 2010 20:19:59 +0300 (MSK) Oleg Bartunov wrote: > Ivan, > > You can write function to get lexemes from tsvector: > CREATE OR REPLACE FUNCTION ts_stat(tsvector, weights text, OUT > word text, OUT ndoc integer, OUT nentry integer) > RETURNS SETOF record AS > $$ > SELECT ts_stat

Re: [GENERAL] ranking how "similar" are tsvectors was: OR tsquery

2010-01-17 Thread Oleg Bartunov
Ivan, You can write function to get lexemes from tsvector: CREATE OR REPLACE FUNCTION ts_stat(tsvector, weights text, OUT word text, OUT ndoc integer, OUT nentry integer) RETURNS SETOF record AS $$ SELECT ts_stat('SELECT ' || quote_literal( $1::text ) || '::tsvector', quote_literal( $2::te

[GENERAL] ranking how "similar" are tsvectors was: OR tsquery

2010-01-17 Thread Ivan Sergio Borgonovo
My initial request was about a way to build up a tsquery that was made similar to what plainto_tsquery does but using | inspite of & as a glue. But at the end of the day I'd like to find similar tsvectors and rank them. I've a table containing several fields that contribute to build up a weighted