1

我正在尝试选择MATCH AGAINST在 MySQL 中使用的产品。

标题的长度指定为单个数字加上m米的字母,即1m,2m5m

当我尝试5m network cable与下面的查询匹配时,它也会返回0.5m network cable1.5m network cable

如何MATCH在 2 个字符的字符串上获得准确的单词?

我的查询:

SELECT title, category, price
FROM products_table
USE index (prod_idx)
WHERE (MATCH (title) AGAINST ('+"5m" +"network" +"cable"' IN BOOLEAN MODE))
4

1 回答 1

0

The problem is that FULLTEXT think of '.' as a word ender/starter/separator, but you want to think of it as a letter. So, turn it into a letter:

When inserting data, change '.' to '_' so that 0.5m becomes 0_5m, which will treated as a word. Do the same change in the search string.

于 2015-03-09T05:17:18.410 回答