MySQL全文搜索,为什么我得到不正确的MATCH参数 [英] MySQL full text search, why am I getting Incorrect arguments to MATCH
本文介绍了MySQL全文搜索,为什么我得到不正确的MATCH参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SELECT
*
FROM
company c
INNER JOIN
city ci ON ci.city_id = c.city_id
INNER JOIN
state s ON s.state_id = c.state_id
WHERE
MATCH (
c.name, ci.name, c.zipcode, s.name
)
AGAINST (
'los angeles'
)
解决方案
MATCH (...)
中的所有列都必须来自同一表,因为它们必须是全文索引,并且MySQL无法为多个表中的数据创建一个索引./p>
SELECT
*
FROM
company c
INNER JOIN
city ci ON ci.city_id = c.city_id
INNER JOIN
state s ON s.state_id = c.state_id
WHERE
MATCH (
c.name, ci.name, c.zipcode, s.name
)
AGAINST (
'los angeles'
)
解决方案
All columns in MATCH (...)
must be from the same table, because they must be fulltext indexed, and MySQL cannot create one index for data in multiple tables.
这篇关于MySQL全文搜索,为什么我得到不正确的MATCH参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文