Re: [GENERAL] TSearch2: find a QUERY that does match a single document

2008-09-13 Thread Dmitry Koterov
> > explain analyze >> select * from test.test_tsq >> where to_tsvector('40x40') @@ q >> > > why do you need tsvector @@ q ? Much better to use tsquery = tsquery > > test=# explain analyze select * from test_tsq where q = > '40x40'::tsque> >

Re: [GENERAL] TSearch2: find a QUERY that does match a single document

2008-09-12 Thread Oleg Bartunov
On Fri, 12 Sep 2008, Dmitry Koterov wrote: Hello. TSearch2 allows to search a table of tsvectors by a single tsquery. I need to solve the reverse problem. *I have a large table of tsquery. I need to find all tsqueries in that table that match a single document tsvector: * CREATE TABLE "test"."

[GENERAL] TSearch2: find a QUERY that does match a single document

2008-09-12 Thread Dmitry Koterov
Hello. TSearch2 allows to search a table of tsvectors by a single tsquery. I need to solve the reverse problem. *I have a large table of tsquery. I need to find all tsqueries in that table that match a single document tsvector: * CREATE TABLE "test"."test_tsq" ( "id" SERIAL, "q" TSQUERY NOT N