我正在使用此查询,但不幸的是它运行缓慢:
SELECT *,
(MATCH(`title`) AGAINST ('$word' IN BOOLEAN MODE) * 2
+ MATCH(`content`) AGAINST ('$word' IN BOOLEAN MODE) * 2
+ MATCH(`url`) AGAINST ('$word' IN BOOLEAN MODE) * 1.1
+ MATCH(`desc`) AGAINST ('$word' IN BOOLEAN MODE) * 1.2) * `like`
AS score
FROM `data`
WHERE MATCH(`content`,`desc`,`title`,`url`) AGAINST ('$word' IN BOOLEAN MODE)
ORDER BY `score` DESC LIMIT 1000
数据库的结果是15000。这意味着将做15000条记录,但查询大约需要25秒的时间。我正在使用 PDO。