通过标签搜索域名?
我确实有 10 万个域名及其相关标签。
我想通过标签搜索域。例如 google.com
域包含 search,google,searchengine,engine,web,reference
标签
bing.com
也包含 search ,bing,searchengine,engine,web
像这样我有多达 100k 个域名及其相关标签。
标准 1
如果我使用 search,google,searchengine,engine,web,reference
标签进行搜索,则 google.com
和 bing.com
这两个域> 应显示在最终结果中。
标准 2
如果我使用标签 search,searchengine,engine,web
进行搜索,那么域 google.com
和 bing.com
也应该出现在结果中
标准 3
如果我使用标签 search,searchengine
进行搜索,那么两个域也应该显示。
标准 4
如果仅标记 search
,则两个域也需要显示。
标准 5
如何使用标签对结果进行优先级排序 假设我使用标签 search,google,searchengine,engine,web,reference
进行搜索,则 google.com
应该排在第一位,< code>bing.com 其次
最后要实现所有这些结果,我应该如何设计我的表以及如何查询表?
谢谢
I do have 100k domains with with their related tags.
I want search domains by their tags. for example google.com
domain is with search,google,searchengine,engine,web,reference
tags
bing.com
also with search,bing,searchengine,engine,web
like this I have upto 100k domains with their related tags.
Criteria 1
If I search with tags say search,google,searchengine,engine,web,reference
then the both domains google.com
and bing.com
should display in final result.
Criteria 2
If I search with tags search,searchengine,engine,web
then also both domains google.com
and bing.com
should appear in results
Criteria 3
If I search with tags search,searchengine
then also both domains should be displayed.
Criteria 4
If only tag search
then also both domains need to be display.
Criteria 5
How do I prioritize result with its tag say if I search with tags search,google,searchengine,engine,web,reference
then google.com
should come first and bing.com
come second
Finally to achieve all these results how should I design my table and how I should query to table?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要至少有两列
domain_name varchar(400), Tags text
- 您需要确保所有标签均以逗号分隔。现在,您将
tags
设为FULLTEXT
类型的索引来执行全文搜索。请参阅此处了解说明。 http://dev.mysql.com/doc/refman/5.0 /en/fulltext-search.html在快速 Google 上,有很多关于利用 MySQL 文本搜索来获取按相关性排序的相关结果的帖子。 (希望这是您想要的)。
一个这样的例子在这里 http://www. pui.ch/phred/archives/2005/05/tags-with-mysql-fulltext.html 它显示了处理标签搜索的各种方法。
You need to have at least two columns
domain_name varchar(400), tags text
-- you need to make sure all tags are comma separated.Now, you make
tags
an index of typeFULLTEXT
to do full text search. See here for description. http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.htmlOn a quick Google, there are many posts on utilizing MySQL text search to get relevant results sorted by relevance. (Hope this is what you wanted).
One such example is here http://www.pui.ch/phred/archives/2005/05/tags-with-mysql-fulltext.html It shows various ways to handle tag searches.