whats the standard text search query?

Started by Pedroalmost 20 years ago2 messagesgeneral
Jump to latest
#1Pedro
pedro100@gmail.com

I have this small web aplication.
When i used mysql i used to do somthing like:

SELECT * FROM table WHERE name like '%searchstring%' OR description like
'%searchstring%';

that doesnt really looks eficient... well... actually it works with no
problem.

anyway... what's the standard query for a text search?

thanks in advance

#2Michael Glaesemann
grzm@seespotcode.net
In reply to: Pedro (#1)
Re: whats the standard text search query?

On May 30, 2006, at 12:46 , Pedro wrote:

SELECT * FROM table WHERE name like '%searchstring%' OR description
like '%searchstring%';

that doesnt really looks eficient... well... actually it works with
no problem.

Depending on your needs, that may work just fine. PostgreSQL includes
regex matching as well.

anyway... what's the standard query for a text search?

If you're looking for full text search, take a look at tsearch2 in
contrib.

Michael Glaesemann
grzm seespotcode net