bcamp1973 Posted August 21, 2006 Share Posted August 21, 2006 i'm building a search engine (albiet a very modest one) for a site i'm workign on. I would like to query a field in the DB for a string contaning multiple words and return results for that string only and not for each instance of the different words in that string. For example...when i do the following...[code]SELECT recipe_id FROM recipe_ingredients WHERE MATCH(ingredient) AGAINST('Garlic Salt')[/code]I get a match for all instances of 'Garlic' *and* all instances of 'Salt'...but i only want instances of 'Garlic Salt'. I fear i may have to build a keyword table or something. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/18155-solved-multi-word-string-in-match-against/ Share on other sites More sharing options...
shoz Posted August 21, 2006 Share Posted August 21, 2006 [code]SELECT recipe_id FROM recipe_ingredients WHERE MATCH(ingredient) AGAINST('"Garlic Salt"' IN BOOLEAN MODE)[/code]http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html Quote Link to comment https://forums.phpfreaks.com/topic/18155-solved-multi-word-string-in-match-against/#findComment-77941 Share on other sites More sharing options...
bcamp1973 Posted August 21, 2006 Author Share Posted August 21, 2006 Awesome, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/18155-solved-multi-word-string-in-match-against/#findComment-78332 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.