0

使用 MATCH AGAINST 执行查询时遇到问题。我正在使用视图来组合表结果,然后在该视图上运行查询。问题是查询在 MariaDB 10.1 中运行得很好,但相同的查询在 Mysql 5.7 中抛出了这个错误:

找不到与列列表匹配的 FULLTEXT 索引

注意:我已经设置了所有相应的全文索引,表格式是 InnoDB。

编辑:这是我的查询:

看法:

CREATE VIEW companies_search AS
SELECT c.*,  ci.city_id, ci.city_title, ci.city_title_eng, adr.address_street 
FROM `companies` as c
LEFT JOIN `addresses` as adr ON adr.`company_id` = c.`company_id`
LEFT JOIN `cities` as ci ON ci.`city_id` = adr.`city_id`

选择查询:

SELECT c.*, ( score_city * 0.05 + topscore_city * 50 + score_city_e * 0.05 + topscore_city_e * 50 ) as sumar 
FROM (SELECT *, 
MATCH(city_title) AGAINST ('"Lond"' IN BOOLEAN MODE) AS topscore_city, 
MATCH(city_title) AGAINST ('Lond' IN BOOLEAN MODE) AS score_city, 
MATCH(city_title_eng) AGAINST ('"Lond"' IN BOOLEAN MODE) AS topscore_city_e, 
MATCH(city_title_eng) AGAINST ('Lond' IN BOOLEAN MODE) AS score_city_e 
FROM `companies_search` GROUP BY company_title_eng) as c 
HAVING sumar > 0 
ORDER BY sumar DESC LIMIT 25 OFFSET 0

我将不胜感激任何帮助

4

0 回答 0