搜索多列时出现SQL全文搜索错误

时间:2016-07-29 08:37:27

标签: mysql phpmyadmin

我在我的问题数据库附加图像中使用以下查询: enter image description here

SELECT *, MATCH(question,short_answer,long_answer) AGAINST('transmission impairment') AS Score
FROM questions
WHERE MATCH(question,short_answer,long_answer) AGAINST('transmission impairment')
ORDER BY score DESC;

我收到以下错误enter image description here

1 个答案:

答案 0 :(得分:0)

以下代码对我有用:

SELECT *, MATCH(long_answer) AGAINST('guided media') AS Score FROM questions WHERE id IN (SELECT id FROM questions WHERE MATCH(long_answer) AGAINST('guided media') UNION SELECT id FROM questions WHERE MATCH(question) AGAINST('guided media') ) ORDER BY score DESC

我仍然觉得这不是最佳解决方案