mysql部分词搜索 [英] mysql partial word searching

查看:250
本文介绍了mysql部分词搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像下面的查询一样搜索,但它在MySQL中不起作用

  SELECT * FROM products WHERE MATCH(title ,说明)
AGAINST('测试'BOOLEAN模式);

我想在下面输出


testproduct,producttest

任何人都可以帮我解决这个问题..?

  SELECT * FROM产品WHERE MATCH(标题,描述)
AGAINST('test *'IN BOOLEAN MODE);

http://dev.mysql.com/doc/refman/4.1/en/fulltext-boolean.html



顺便说一句,当MySQL的全文搜索网站请求很大时,它会成为瓶颈,而且对于某些特殊的搜索词来说,它是脆弱和不稳定的,因此往往会导致查询和数据库崩溃。尽快使用Elastic Search。


I want to search like the below query but it is not working in MySQL

 SELECT * FROM products WHERE MATCH (title,description) 
 AGAINST ('test' IN BOOLEAN MODE); 

I want below output

testproduct, producttest

Can anybody help me on this..?

解决方案

currently, only support prefix, not support suffix:

SELECT * FROM products WHERE MATCH (title,description) 
 AGAINST ('test*' IN BOOLEAN MODE); 

http://dev.mysql.com/doc/refman/4.1/en/fulltext-boolean.html

By the way, MySQL full text search will be bottleneck when the website request is large, and it is vulnerable and unstable for some special search word, thus often lead to slow query and database crash. Use Elastic Search as soon as possible.

这篇关于mysql部分词搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆