Re: FTS question - Mailing list pgsql-general

From Richard Huxton
Subject Re: FTS question
Date
Msg-id 4869E24F.7010104@archonet.com
Whole thread Raw
In response to FTS question  (Damjan Rems <d_rems@yahoo.com>)
Responses Re: FTS question
List pgsql-general
Damjan Rems wrote:
> SELECT * FROM clients
> WHERE to_tsvector('english',name) @@ to_tsquery( 'english','somestring');
>
> But if I want to query just part of the string return set is empty:
> SELECT * FROM clients
> WHERE to_tsvector('english',name) @@ to_tsquery( 'english','somes');
>
> returns no results.
>
> Is it that postgresql doesn't support substring queries or have I missed something. I can not find anything on the
net.Postgresql is v8.3.1. 

Um - you're using the full-text indexing. It's supposed to search words.

You can use any of the pattern-matching functions / operators (LIKE etc)
here if you want to explicitly match characters.
http://www.postgresql.org/docs/current/static/functions-matching.html

If that's not what you're after, you'll need to explain what you are
trying to do.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Sheikh Salman Ahmed
Date:
Subject: Query Fails
Next
From: "A. Kretschmer"
Date:
Subject: Re: Query Fails