Reputation: 398
I am using fulltext search in a project. I want to search multiple words but i have a problem. So my query is;
SELECT MAX(id)
FROM table
WHERE MATCH (col1,col2) AGAINST ('+(word1) +(word2) +(word3 word4)')
GROUP BY col1
ORDER BY 1 desc limit 12
And this query is searches including word1 OR word2 OR word3 OR word4 but i want to search including word1 OR word2 OR word3 word4
So what is the solution?
Upvotes: 1
Views: 2258
Reputation: 97
SELECT * FROM `user_profiles`
WHERE MATCH (`first_name`,`last_name`)
AGAINST ('(+bruce+wayne)(+clark+kent)' IN BOOLEAN MODE)
Upvotes: -1