我可以使用字段名称作为AGAINST参数

时间:2016-03-31 16:42:39

标签: mysql sql full-text-search

可能是SqlFiddle Sql Fiddle Demo

上的错误
SELECT `ID`, `Name1`, `Name2`,
       MATCH (`Name1`)  
       AGAINST ('Ministry Sound' IN BOOLEAN MODE) AS score 
FROM Table3
ORDER BY score DESC;

生成此结果:

| ID |             Name1 |          Name2 |               score |
|----|-------------------|----------------|---------------------|
|  1 | Ministry of Sound | Ministry Sound | 0.45528939366340637 |
|  2 |        4 Elements |  Four Elements |                   0 |
|  3 | Blue Marlin Ibiza |    Blue Marlin |                   0 |

但如果我尝试使用Name2代替'Ministry Sound',那么请比较每一行我都会收到错误

  

AGAINST

的参数不正确

0 个答案:

没有答案