I need to find the following string: 'c++'
My sql query look like this:
SELECT *
FROM shop_product
WHERE
MATCH(shop_product.name, shop_produc开发者_C百科t.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.
Words with less than four characters are not searched in BOOLEAN MODE or NATURAL MODE.
"+" isn't a "word" character. Probably you have to use LIKE or REGEXP.
You could search without BOOLEAN MODE:
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++'))
GROUP BY `product_id`
LIMIT 0, 25
I think the + is just for boolean mode a special character.
精彩评论