Mysql MATCH AGAINST - IN BOOLEAN MODE 问题
我需要找到以下字符串: 'c++'
我的 sql 查询如下所示:
SELECT *
FROM shop_product
WHERE
MATCH(shop_product.name, shop_product.product_model, shop_product.keywords, shop_product.part_number, shop_product.upc, shop_product.brand_name)
AGAINST ('c++' IN BOOLEAN MODE))
GROUP BY `product_id`
LIMIT 0, 25
即使存在包含该单词的记录,此脚本也不会返回任何结果。 怎么解决这个问题呢?
谢谢。
I need to find the following string: 'c++'
My sql query look like this:
SELECT *
FROM shop_product
WHERE
MATCH(shop_product.name, shop_product.product_model, shop_product.keywords, shop_product.part_number, shop_product.upc, shop_product.brand_name)
AGAINST ('c++' IN BOOLEAN MODE))
GROUP BY `product_id`
LIMIT 0, 25
This script does not return any results even if there exists records containing that word.
How to solve this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在布尔模式或自然模式下不会搜索少于四个字符的单词。
Words with less than four characters are not searched in BOOLEAN MODE or NATURAL MODE.
“+”不是“单词”字符。也许您必须使用 LIKE 或 REGEXP。
"+" isn't a "word" character. Probably you have to use LIKE or REGEXP.
您可以在没有布尔模式的情况下进行搜索:
我认为 + 只是布尔模式的特殊字符。
You could search without BOOLEAN MODE:
I think the + is just for boolean mode a special character.