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? Link to comment https://forums.phpfreaks.com/topic/33961-donig-an-index-search-remind-me-again/ 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. Link to comment https://forums.phpfreaks.com/topic/33961-donig-an-index-search-remind-me-again/#findComment-159558 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... Link to comment https://forums.phpfreaks.com/topic/33961-donig-an-index-search-remind-me-again/#findComment-159569 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' Link to comment https://forums.phpfreaks.com/topic/33961-donig-an-index-search-remind-me-again/#findComment-159871 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? Link to comment https://forums.phpfreaks.com/topic/33961-donig-an-index-search-remind-me-again/#findComment-160012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.