Reputation: 133
How to use mysql fulltext search to search for phrases instead of like :
SELECT description FROM t WHERE info LIKE "%Search phrase one%" OR info LIKE "%Phrase second%" OR info LIKE "%Another phrase with more words%"
Upvotes: 2
Views: 4357
Reputation: 633
Here's a sample query for searching phrases:
SELECT * FROM table WHERE MATCH ( col1,col2,col3 )
AGAINST ('"some words" "another phrase"' IN BOOLEAN MODE);
More infos at : http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html
Upvotes: 3