Skip site navigation (1) Skip section navigation (2)

multi-word expression full-text searching

From: "Fco(dot) Mario Barcala" Rodríguez <lbarcala(at)freeresearch(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: multi-word expression full-text searching
Date: 2008-06-30 15:50:02
Message-ID: 1214841002.5802.18.camel@tambre (view raw or flat)
Thread:
Lists: pgsql-general
Hello all:

I'm testing all full-text searching possibilities of PostgreSQL and...

Is it possible to search for a multi-word expression?

I can search one or more words:

SELECT id FROM document WHERE to_tsvector('english',text) @@
to_tsquery('english','despite');

SELECT id FROM document WHERE to_tsvector('english',text) @@
to_tsquery('english','despite & subject');

But it seems not be possible to do a query like:

SELECT id FROM document WHERE to_tsvector('english',text) @@
to_tsquery('english','despite this');

to search the documents in which occur the expression "despite this".
This last query gives the following error:

ERROR:  syntax error in tsquery: "despite this"

Is it really impossible to searh a multi-word expression?

Thanks in advance,

  Mario Barcala


Responses

pgsql-general by date

Next:From: Merlin MoncureDate: 2008-06-30 16:24:24
Subject: Re: Advice Wanted on Selecting Multi-row Data Requests in 10-Row Blocks
Previous:From: A BDate: 2008-06-30 15:48:58
Subject: Re: "The tuple structure of a not-yet-assigned record is indeterminate."

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group