热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

查找关键字的最快方法。任何语言,任何系统-Fastestwaytolookupkeywords.Anylanguage,anysystem

DailyIhave5millionorsouniquekeywordswithanimpressioncountforeachone.Iwanttobeabl

Daily I have 5 million or so unique keywords with an impression count for each one. I want to be able to look these keywords up by certain words so for instance if I have "ipod nano 4GB" I want to be able to pull that out if I search for "ipod", "nano", or "4GB". mySQL can't seem to handle that much data for what I want, I've tried Berkeley but that seems to crash with too many rows and it's slower. Ideas?

每天我有500万左右的独特关键字,每个关键字都有一个展示次数。我希望能够通过某些单词来查看这些关键字,例如,如果我有“ipod nano 4GB”,我希望能够在我搜索“ipod”,“nano”或“4GB”时将其拉出来。 mySQL似乎无法为我想要的东西处理那么多数据,我已经尝试过伯克利但是它看起来会因太多行而崩溃而且速度较慢。想法?

5 个解决方案

#1


I'm quite happy with the Xapian search engine library. Although it sounds like it might be overkill for your scenario, maybe you just want to chuck your data into a big hashtable, like perhaps memcached?

我对Xapian搜索引擎库感到非常满意。虽然听起来对你的场景来说可能有些过分,但也许你只想将你的数据放入一个大的哈希表中,就像memcached一样?

#2


you can try free text on mssql. http://msdn.microsoft.com/en-us/library/ms177652.aspx

你可以尝试在mssql上的自由文本。 http://msdn.microsoft.com/en-us/library/ms177652.aspx

Example query:

SELECT TOP 10 * FROM searchtable 
INNER JOIN FREETEXTTABLE(searchtable, [SEARCH_TEXT], 'query string') AS KEY_TBL
ON searchtable.SEARCH_ID = KEY_TBL.[KEY] 
ORDER BY KEY_TBL.RANK DESC

Josh

#3


A Lucene index might work. Ive used it for pretty big datasets before. It's developed in java but there is also a .NET version.

Lucene索引可能有效。我以前用它来制作相当大的数据集。它是用java开发的,但也有一个.NET版本。

#4


Have you tried fulltext search in MySQL ? Because if you tried it with LIKE comparison, I see why it was slow :).

你在MySQL中尝试过全文搜索吗?因为如果你尝试使用LIKE比较,我明白为什么它很慢:)。

#5


That workload and search pattern is trivial for PostgreSQL with its integrated full text search functionality (integrated as of 8.4 which is now in RC status. It's a contrib module prior to that.)

PostgreSQL具有集成的全文搜索功能(从8.4开始集成,现在处于RC状态。这是之前的一个贡献模块。)工作负载和搜索模式是微不足道的。


推荐阅读
author-avatar
banli
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有