From: | Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: OR tsquery |
Date: | 2010-01-16 20:57:03 |
Message-ID: | 20100116215703.6d2b79a9@dawn.webthatworks.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Sat, 16 Jan 2010 19:10:45 +0300 (MSK)
Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:
> Ivan,
> did you ever read official documentation ?
> http://www.postgresql.org/docs/8.4/static/textsearch-controls.html
Yes but I still can't find something that works like plainto_tsquery
but with | or any example that wouldn't make obtaining that result
convoluted.
plainto_tsquery do a couple of stuff that I find hard to replicate
with the available functions.
It split a string into lexemes.
It loops over the lexemes to build up the query with &.
Something like:
select (
string_to_array(
strip(
to_tsvector('pg_catalog.english',
'orange banana woods booking'))::text
, ' ')
)[i]
from generate_series(0,3) s(i);
and then gluing up the pieces with |.
And the above example still miss to solve some of the details like
cleaning the '.
Another option would be to return the tsvector to the client and
then build the tsquery there and send it back to the server.
I'm on 8.3 but I don't think it makes any real difference for this.
Sorry if I'm still missing the obvious.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
From | Date | Subject | |
---|---|---|---|
Next Message | Greg Stark | 2010-01-16 21:10:53 | Re: Collate order on Mac OS X, text with diacritics in UTF-8 |
Previous Message | Mathieu De Zutter | 2010-01-16 19:40:43 | Re: Constraint exclusion issue |