Re: multi-word expression full-text searching

From: lbarcala(at)freeresearch(dot)org
To: pgsql-general(at)postgresql(dot)org
Subject: Re: multi-word expression full-text searching
Date: 2008-07-01 09:32:29
Message-ID: 56032.193.145.220.56.1214904749.squirrel@mail.freeresearch.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> 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.

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chandra ASGI Tech 2008-07-01 09:34:26 Re: Need some help
Previous Message Chandra ASGI Tech 2008-07-01 09:21:57 Re: Query Fails