我有一个ID,主题,描述,图像URL为列的表。
像这样的条目

id   topic               description    image_url
1    People and blogs    TownHall       http://...
2    People and blogs 2  ......         .......
3    Blogs               .......        .......
4    Good                ......         ......


当我搜索博客作为查询输入时

SELECT * FROM people
WHERE MATCH(topic,descript) AGAINST ("blogs" WITH QUERY EXPANSION)


我正在获得结果

1  People and blogs    TownHall    http://.../
2  People and blogs 2  ......      ......./
3  Blogs               .......     ......./


第三行应排在最前面,因为它是确切的单词(博客),其余行应在此之后。

请帮我调试一下。

最佳答案

尝试类似的东西:

SELECT * FROM people,
MATCH(topic,descript) AGAINST ("blogs" WITH QUERY EXPANSION) AS score
WHERE score > 0
ORDER BY score DESC

10-08 05:03