gpt4 book ai didi

php - MySQL 全文在特定表上失败

转载 作者:行者123 更新时间:2023-11-29 09:21:44 24 4
gpt4 key购买 nike

我一直在绞尽脑汁地想知道为什么会失败,我有以下代码

$query = "
SELECT DISTINCT title, caption, message, url, MATCH(title, caption, message, url) AGAINST ('$searchstring' ) AS score FROM news WHERE (valid = 1) AND MATCH(title, caption, message, url) AGAINST ('$searchstring' ) UNION ALL
SELECT DISTINCT title, caption, message, url, MATCH(title, caption, message, url) AGAINST ('$searchstring' ) AS score FROM paged WHERE (valid = 1) AND MATCH(title, caption, message, url) AGAINST ('$searchstring' ) ORDER BY score DESC";

我可以从分页表中获取搜索结果,但不能从新闻表中获取搜索结果

最佳答案

我对问题所在的猜测:停用词。

来自documentation :

The stopword list applies. In addition, words that are present in 50% or more of the rows are considered common and do not match.

如果 paged 不满足条件,但 news 满足条件,那么您将得到其中一个的结果,而不是另一个的结果。

关于php - MySQL 全文在特定表上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1567847/

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