|List:||General Discussion||« Previous MessageNext Message »|
|From:||Mogens Melander||Date:||May 4 2007 8:59am|
|Subject:||Re: How do I find products when a user types freeform strings like |
'Sony 20" TV' or '20" Sony TV'?
|View as plain text|
On Fri, May 4, 2007 10:21, Daevid Vincent wrote: > I'm having trouble figuring out the logic/query I want. > I know that all those "OR"s are not right. > I'm doing this in PHP and mySQL (of course), > so if it can't be done with a single query, I can split it up. > > Here's the challenge, given a text field search box, someone enters: > > Sony 20" TV > > How do I search for that, not knowing which fields are which? > For example, they could have also entered: > > 20" Sony TV > How about: select soundex('Sony 20" TV' ),soundex('20" Sony TV'); 'S531', 'S531' -- Later Mogens Melander +45 40 85 71 38 +66 870 133 224 -- This message has been scanned for viruses and dangerous content by OpenProtect(http://www.openprotect.com), and is believed to be clean.