From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
---|---|
To: | lbarcala(at)freeresearch(dot)org |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: multi-word expression full-text searching |
Date: | 2008-07-01 10:25:00 |
Message-ID: | Pine.LNX.4.64.0807011424110.11363@sn.sai.msu.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, 1 Jul 2008, lbarcala(at)freeresearch(dot)org wrote:
>>
>> SELECT id FROM document WHERE to_tsvector('english',text) @@
>> plainto_tsquery('english','despite this');
>> --
>> Teodor Sigaev
>
> If I understand well the plainto_tsquery behaviour, this query match with:
>
> Despite this, the president went out.
> Despite the event, this question arise.
You want 'phrase search', which doesn't supported yet. There are
several workarounds, search archives for 'phrase search'
>
> i.e., if "this" is not inside the stopwords list, the query is translated to:
> SELECT id FROM document WHERE to_tsvector('english',text) @@
> to_tsquery('english','despite & this');
>
> It searches for documents which include "despite" and "this", and not for
> ones which have the expression "despite this".
>
> I have made some tests and they confirm my explanations.
>
> Thank you anyway.
>
> Any other solution?
>
> Mario Barcala
>
>
>
>
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru)
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
From | Date | Subject | |
---|---|---|---|
Next Message | Allan Kamau | 2008-07-01 10:30:48 | Re: Need some help |
Previous Message | Pavel Stehule | 2008-07-01 09:56:15 | Re: Problems with a C function, pg_uname(), and String concatenation. |