[thelist] constructing a good search string/query

Dan McCullough dan.mccullough at gmail.com
Mon May 2 14:01:39 CDT 2005


Wanted a search function that would query my product summary table,
basically a long string of the colors, description, sizes, and other
information for a product, and have it return a result.


Guess what?  Its SLOWWWWWWWWWWWWWWWWWWWW!
:) Not surprised by that.  So what I am looking for is some advice to
speed it up, and possibly add in some smarts.

Here is the query.
select * from search_string where lower(searchstring) like '%"+searchTerm+"%'

searchTerm can be red, which returns all items with red, and large and
so forth.  however mispelling a name by 1 letter, like leaving off a
"n" out of "Conner" will cause you to get no results.

any thoughts or help.


More information about the thelist mailing list