I’m trying to run a simple query like this:
SELECT *,
MATCH(`col1`,`col2`)
AGAINST ('some text') AS score
FROM `mytable` ORDER BY score DESC
This always gives the error:
#1191 - Can't find FULLTEXT index matching the column list
But if I split the columns and do two queries like this:
SELECT *,
MATCH(`col1`)
AGAINST ('some text') AS score
FROM `mytable` ORDER BY score DESC
and:
SELECT *,
MATCH(`col2`)
AGAINST ('some text') AS score
FROM `mytable` ORDER BY score DESC
Then that works. Why can’t I match against both columns at the same time? I see an example on the manual doing almost exactly the same thing like this:
mysql> SELECT id, body, MATCH (title,body) AGAINST
-> ('Security implications of running MySQL as root') AS score
-> FROM articles WHERE MATCH (title,body) AGAINST
-> ('Security implications of running MySQL as root');
#1191 - Can't find FULLTEXT index matching the column listYou need to have FULLTEXT index on both the columns together.
FULLTEXT (col1,col2)