Search Postgresql Archives

Re: FTS question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux