|List:||General Discussion||« Previous MessageNext Message »|
|From:||Baron Schwartz||Date:||May 4 2007 12:31pm|
|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|
Hi Daevid, 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 I think you're describing full-text indexing. MySQL supports it but only on MyISAM tables. If you don't want to use MyISAM, full-text search engines like Lucene or Sphinx may be worth looking at. Baron