Search code examples
mysqldatabasematch-against

MySQL Match Against with Multiple Values to AGAINST


I think this is a very simple query but I just can't find it in any of my programming books or on the net.

I have this query: SELECT * FROM test WHERE MATCH (column1,column2) AGAINST ('value1');

But I need AGAINST to have multiple values e.g. (value1,value2,value3)

can anyone help?


Solution

  • I think the BOOLEAN MODE modifier might be what you are looking for.

    SELECT * FROM test WHERE MATCH (column1,column2) 
         AGAINST ('+value1 +value2 +value3' IN BOOLEAN MODE);