I have field called keywords and the stored info is a keywords separated with |
For example:
sky|Banana is good|apple|apple is red|sky is blue|green
What i'm try to do is search in that field and find results that contains at least one of the keywords.
For that i used MATCH AGAINST in BOOLEAN MODE
SELECT * FROM mytable
WHERE MATCH(kewords)
AGAINST ('+sky is blue +Banana is good +otherword' IN BOOLEAN MODE)
But results is goes wrong, for example it will select results that contains +sky is blue and also with a single word sky
I know how to solve that in PHP, but i'm looking for MYSQL solution, i thought Match AGAINST is what i'm looking for.
One way to do this is with
LIKE, fencing the search words with the delimiter:This ensures that the search phrase must match exactly (i.e.
sky is bluewill not matchsky).If you want all the phrases to be present (instead of any), just change the
ORtoAND.