how to make myisam table to return results that are matching with different combination of words and nothing more extra from given search string.
I am using the following query on my tags table
SELECT * FROM tags WHERE MATCH (name) AGAINST('word1 word2'));
and the table might contain rows as follows
i need only the following rows as results
but the actual result i am getting is
how to achieve this??
I have tried boolean mode search with + but it makes that the words given + as compulsory in search results which is not what i want.
This may be a late reply, yet, this will solve the issue. Use IN BOOLEAN MODE of MySQL FTS.
SELECT * FROM `tags` WHERE MATCH (`name`) AGAINST('+word1 +word2' IN BOOLEAN MODE)
Take a look at Full Text Boolean Mode
Note In implementing this feature, MySQL uses what is sometimes referred to as implied Boolean logic, in which
+stands for AND
-stands for NOT
[no operator]implies OR
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With