简体   繁体   English

MATCH AGAINST不适用于两个LEFT JOIN:#1210-MATCH的参数不正确

[英]MATCH AGAINST not working with two LEFT JOIN: #1210 - Incorrect arguments to MATCH

I have three tables in my MySQL database: books , authors and cities . 我的MySQL数据库中有三个表: booksauthorscities

books has the columns: id , author_id books具有以下列: idauthor_id

authors has the columns: id , author , city_id authors具有以下列: idauthorcity_id

cities has the columns: id , city cities有列: idcity

Running 跑步

SELECT *, books.id, authors.author FROM books LEFT JOIN authors ON books.author_id = authors.id WHERE MATCH (authors.author) AGAINST ("peter" IN BOOLEAN MODE);

via SQL tab in phpMyAdmin everything works fine. 通过phpMyAdmin中的SQL选项卡,一切正常。

But taking another LEFT JOIN like 但考虑另一个LEFT JOIN

SELECT *, books.id, authors.author, cities.city FROM books LEFT JOIN authors ON books.author_id = authors.id LEFT JOIN cities ON authors.city_id = cities.id WHERE MATCH (authors.author, cities.city) AGAINST ("peter" IN BOOLEAN MODE);

I'm getting the error message 我收到错误消息

MySQL said: Documentation MySQL说:文档

#1210 - Incorrect arguments to MATCH #1210-匹配参数不正确

I made many tests and it seems like MATCH AGAINST doesn't work with two LEFT JOIN . 我做了很多测试,好像MATCH AGAINST不能和两个LEFT JOIN But I couldn't find anything in the internet. 但是我在互联网上找不到任何东西。 I also tried to use JOIN instead of LEFT JOIN but without success. 我也尝试使用JOIN代替LEFT JOIN但是没有成功。

All columns definitely exist. 所有列肯定存在。

Any idea what I can do? 知道我能做什么吗?

If any more information needed, just ask. 如果需要更多信息,请询问。

我找到了解决方案:列citiesInnoDB而不是MyISAM就像其他表格一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM