gpt4 book ai didi

mysql - 如何在mysql全文搜索中获取相关搜索?

转载 作者:行者123 更新时间:2023-11-29 17:14:43 24 4
gpt4 key购买 nike

我想要确切的“果阿生产厂”的相关性。它还会产生包含 Goa 的任何内容。

SELECT * FROM `app_search` WHERE MATCH (`keywords`) AGAINST
("production house in goa" in boolean mode)
order by MATCH (`keywords`) AGAINST ("production house in goa" in boolean mode)
desc, rank desc;

谢谢

最佳答案

删除旧表并使用关键字全文索引和以下查询重新创建可以解决问题。

SELECT *, MATCH (`keywords`) AGAINST
('software development in florida'
IN BOOLEAN MODE) AS score
FROM `ftextsearch` WHERE MATCH (keywords) AGAINST
('software development in florid'
IN BOOLEAN MODE) order by score desc,rank desc

查询还返回分数中搜索的相关性。

关于mysql - 如何在mysql全文搜索中获取相关搜索?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51700526/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com