Mysql搜索域名 [英] Mysql Search for Domain Names

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

问题描述

我有一张充满了域名的表格。我想做一个搜索,它会返回一些相关性结果。我的问题是,如果我搜索酷,我希望它返回cooldomain.com,全文搜索,除非我做错了,否则不会。



是否有任何我不知道的全文选项可以实现这一点?如果没有,我该怎么做呢?

解决方案

我会在这里使用LIKE,全文搜索用于匹配满单词或表达式,查询扩展等。我认为 * 运算符只能在使用MATCH时作为后缀使用,所以您会错过imcool.com ...



我认为您必须收集更多信息才能进行相关性排序。

编辑:
If你想使用一个索引,你也可以在另一个列中存储域的单词,并使用全文搜索的力量...


I have a table full of domain names. I'd like to do a search that returns some kind of relevancy results on it. My problem, is that if I do a search for "cool" I want it to return "cooldomain.com", which a fulltext search, unless I'm doing it wrong, will not.

Are there any fulltext options I'm unaware of that will accomplish this? If not, how would I go about doing it?

解决方案

I'd use LIKE here, fulltext search is for matching against full words or expressions, query expansion, etc. And I think the * operator can only be used as a suffix when using MATCH, so you'll miss imcool.com...

I think you'll have to gather more information to make a relevancy sorting.

Edit: If you want to use an index, you can also store the words of the domain in another column, and use the power of fulltext search on this one...

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

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