From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | d_rems(at)yahoo(dot)com |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: FTS question |
Date: | 2008-07-01 07:52:47 |
Message-ID: | 4869E24F.7010104@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | A. Kretschmer | 2008-07-01 08:12:30 | Re: Query Fails |
Previous Message | Oleg Bartunov | 2008-07-01 07:45:41 | Re: FTS question |