我有两张桌子。在将它们连接在一起的查询中,我尝试进行如下全文搜索:
SELECT o44_1_0.attr_80748_ AS attr_80737_, MATCH o44_1_0.attr_80748_ AGAINST ('something' IN BOOLEAN MODE) AS relev
FROM object_80726_ f1
LEFT OUTER JOIN (
SELECT id_field, attr_80748_ FROM (
SELECT m0.id_field, attr_80748_ FROM object_80738_ o
INNER JOIN master_slave m0 ON (m0.id_object = 80726) AND (m0.id_master = 80738) AND m0.id_slave_field = o.id
ORDER BY o.id_order
) AS o GROUP BY id_field
) AS o44_1_0 ON f1.id = o44_1_0.id_field
对你来说可能看起来很糟糕,但是不要注意查询的细节。看看我如何进行全文搜索:
...MATCH o44_1_0.attr_80748_ AGAINST ('something' IN BOOLEAN MODE) AS relev...
此部分查询导致错误:
Error Code : 1214
The used table type doesn't support FULLTEXT indexes
如果我发表评论,那么一切都好。但是,错误似乎不正确,因为如果我在连接表本身中进行全文搜索,那么查询运行没有任何问题。所以,这有效:
SELECT attr_80748_, MATCH attr_80748_ AGAINST ('something' IN BOOLEAN MODE) AS relev
FROM object_80738_
所以,同一个表和相同的字段,但这次mysql不会抛出任何错误。