[thelist] constructing a good search string/query

Simon Willison cs1spw at bath.ac.uk
Mon May 2 14:50:57 CDT 2005


On 2 May 2005, at 20:01, Dan McCullough wrote:
> 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.

Have you looked in to some kind of external search indexing software?  
I've had excellent results in the past with Swish-E, which is open  
source:

http://www.swish-e.org/

The downside is that you it needs installing, which means it probably  
isn't suitable for shared hosting accounts. It's fantastic if you can  
run it though.

Cheers,

Simon Willison
http://simon.incutio.com/


More information about the thelist mailing list