mysql 声明变量 美元_mysql全文搜索无法搜索美元符号?

你试图匹配3个字符串,而默认值是4(我想这也是你的情况) .

它在MySQL文档的_835335页面上说:

Any word that is too short is ignored. The default minimum length of words that are found by full-text searches is four characters.

检查this以进行微调全文搜索:

For example, if you want three-character words to be searchable,

you can set the ft_min_word_len variable by putting the following

lines in an option file:

[mysqld]

ft_min_word_len=3

UPDATE:

来自MySQL文档:

A phrase that is enclosed within double quote (“"”)

characters matches only rows that contain the

phrase literally, as it was typed.

The full-text engine splits the phrase into words

and performs a search in the FULLTEXT index for the words.

Nonword characters need not be matched exactly:

Phrase searching requires only that matches contain exactly

the same words as the phrase and in the same order.

For example, "test phrase" matches "test, phrase".

这基本上意味着你可以尝试用双引号括起搜索短语的全文搜索,只要美元符号是你的列值中唯一的美元和价格之间的特殊字符(它们之间也没有空格),你就可以获得所需的结果 . 但是,FULLTEXT搜索用于单词搜索,并且忽略特殊字符,因此依赖于此非常危险 .

如果数据库中的更改不可能,您可以考虑使用SPHINX进行全文搜索 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值