michaellunsford Posted January 12, 2007 Share Posted January 12, 2007 numerous search fields combining to one search... for example... "123 N Main Street" is actually four fields. I had indexed them about a year ago, but can't remember how to do the search? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 12, 2007 Share Posted January 12, 2007 Well, you could use a fulltext index, but I think it chokes on numbers. Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted January 12, 2007 Author Share Posted January 12, 2007 I just forget the search language....instead of[code]SELECT * FROM `addresses` WHERE `num` = '123' AND `dir` = 'N' AND `street_name` = 'Main' AND `street_type` = 'street'[/code]I think it used a like and separated a single search field by "%"[code]SELECT * FROM `addresses` WHERE `indexed_search` LIKE '%123%N%Main%Street%'[/code]BUT using the name of the fulltext index like I would a column gives me an unknown column error... Quote Link to comment Share on other sites More sharing options...
Barand Posted January 13, 2007 Share Posted January 13, 2007 If you have a fulltext index use .. WHERE MATCH (col1,col2,...) AGAINST (expr )By default, words of 3 or less characters are ignored so it will only use 'main' and 'street' Quote Link to comment Share on other sites More sharing options...
michaellunsford Posted January 13, 2007 Author Share Posted January 13, 2007 I think that's it... less than three characters might not be the best solution, though. 123 N Main St for example would only search "Main", right? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.