使用match-against执行查询时出现问题。我使用视图来组合表和结果,然后在该视图上运行查询。问题是,在mariadb 10.1中,查询运行得很好,但在mysql 5.7中,同样的查询会引发以下错误:
找不到与列列表匹配的全文索引
注意:我已经设置了所有相应的全文索引,表格式是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
我会感激任何帮助
暂无答案!
目前还没有任何答案,快来回答吧!