前几天的调研( Rails3下的 full text search (全文本搜索, 全文匹配?) ), 我发现了两个不错的候选:
1. lucene (solr, elasticsearch 都是基于它)
2. sphinx
两者都有很不错的口碑。所以今天更加进一步的调查。把看到的有价值的文章记录在这里:
1. http://stackoverflow.com/questions/737275/comparison-of-full-text-search-engine-lucene-sphinx-postgresql-mysql
------------
回答1. Result relevance ranking is the default. You can set up your own sorting should you wish, and give specific fields higher weightings.
结果相关度 是排序的默认条件。你也可以自行指定,也可以配置不同列的权重。
Indexing speed is super-fast, because it talks directly to the database. Any slowness will come from complex SQL queries and un-indexed foreign keys and other such problems. I've never noticed any slowness in searching either.
由于直接跟数据库对话,它建立索引的速度超快,除非你的SQL语句非常复杂,或者某个列没有使用索引。我的项目中没遇到这些问题。
The search service daemon (searchd) is pretty low on memory usage - and you can set limits on how much memory the indexer process uses too.
搜索服务进程占用资源极小,你也可以指定内存大小的分配。
Scalability is where my knowledge is more sketchy - but it's easy enough to copy index files to multiple machines and run several searchd daemons. The general impression I get from others though is that it's pretty damn good under high load, so scaling it out across multiple machines isn't something that needs to be dealt with.
扩展性: 我对它了解的不多。但是很容易把一份索引COPY到多个服务器上,然后再跑多个搜索进程。 从其他人那里了解的情况是:在高压高并发下,单极表现就足够好了!所以没必要考虑把它做成分布式。。。
There's no support for 'did-you-mean', etc - although these can be done with other tools easily enough. Sphinx does stem words though using dictionaries, so 'driving' and 'drive' (for example) would be considered the same in searches.
它不支持查询纠正(“你是不是想搜索OOXX”? ) Sphinx 使用字典进行分词,所以driving 和 drive 返回的搜索结果是一样的。
------------
回答2.
I don't know Sphinx, but as for Lucene vs a database full-text search, I think that Lucene performance is unmatched. You should be able to do almost any search in less than 10 ms, no matter how many records you have to search, provided that you have set up your Lucene index correctly.
我没用过Shpinx,但是跟数据库相比的话,lucene的能力是无可匹敌的。你几乎可以在10ms内做任何搜索,不管目标的数据量有多大。(前提是你正确的建立好了索引)
Here comes the biggest hurdle though: personally, I think integrating Lucene in your project is not easy. Sure, it is not too hard to set it up so you can do some basic search, but if you want to get the most out of it, with optimal performance, then you definitely need a good book about Lucene.
这里有个最大的门槛:个人以为,在项目中集成lucene并不容易。当然了,建立具备基本功能的原型并不难,但是你想要优化的话,你手边有一本非常好的书才行。
As for CPU & RAM requirements, performing a search in Lucene doesn't task your CPU too much, though indexing your data is, although you don't do that too often (maybe once or twice a day), so that isn't much of a hurdle.
检索时它对CPU和内存的需求很小, 建立索引时却不小,不过估计你每天重建索引的次数也不多,所以估计问题不大。
http://stackoverflow.com/a/2288211/445908
elasticsearch 的作者的回答:
As the creator of ElasticSearch, maybe I can give you some reasoning on why I went ahead and created it in the first place.
做为ElasticSearch的作者,也许我可以解释一下我建立这个项目的缘由。
Using pure Lucene is challenging. There are many things that you need to take care for if you want it to really perform well, and also, its a library, so no distributed support, its just an embedded Java library that you need to maintain.
使用Lucene有一定的挑战性。想要用好它的话,你需要时刻留心很多东西。而且它只是一个jar包,不支持分布式。
In terms of Lucene usability, way back when (almost 6 years now), I created Compass. Its aim was to simplify using Lucene and make everyday Lucene simpler. What I came across time and time again is the requirement to be able to have Compass distributed. I started to work on it from within Compass, by integrating with data grid solutions like GigaSpaces, Coherence and Terracotta, but its not enough.
在使用性方面。。。还得谈及6年前我建立 Compass 这个项目。它的目的是把使用和维护Lucene 变得简单些。而我当时屡次遇到这样的需求:让Compass支持分布式。 于是我以此为起点开始工作, 集成了 data grid 解决方案(例如Gigaspaces .... )但是这些努力还不够。
At its core, a distributed Lucene solution needs to be sharded. Also, with the advancement of HTTP and JSON as ubiquitous APIs, it means that a solution that many different systems with different languages can easily be used.
分布式Lucene解决方案的核心是: 数据库需要水平分区的。(sharded, 词条见:shard ) 同时,还要使用 HTTP 和JSON 的形式来做为API。这样的优势是:不论什么语言,都可以轻易的调用它。
This is why I went ahead and created ElasticSearch. It has a very advance distributed model, speaks natively JSON, and exposes many advance search features, all seamlessly expressed through JSON DSL.
这就是我建立ElasticSearch的原因。 它用有先进的分布式模型, 本地语言是JSON, 还提供了很多查询特性。 这些都使用JSON形式的DSL来访问。
Solr is also a solution for exposing an indexing/search server over HTTP, but I would argue that ElasticSearch provides a much superior distributed model and ease of use (though currently lacking on some of the search features, but not for long, and in any case, the plan is to get all Compass features into ElasticSearch). Of course, I am biased, since I created ElasticSearch, so you might need to check for yourself.
Solr 也是一个通过HTTP 访问的检索/查询解决方案,但是我觉得 ElasticSearch 提供了更好的分布式模型,也更容易使用(尽管目前看来, ElasticSearch还缺少某些检索特性,但是在不远的将来,我保证,会把Compass所有的特性都移植到ElasticSearch中去) 当然了,做为作者,我的话肯定会偏向于ElasticSearch,所以你最好亲自试一下。
As for Sphinx, I have not used it, so I can't comment. What I can refer you is to this thread at Sphinx forum which I think proves the superior distributed model of ElasticSearch.
对于 Sphinx,我没用过。所以也就不评价它了。不过从 Sphinx 论坛的这篇文章看来,ElasticSearch 提供了更好的 分布式模型。
Of course, ElasticSearch has many more features then just being distributed. It is actually built with cloud in mind. You can check the feature list on the site.
当然了,除了更好的分布式模型,ElasticSearch 还提供了很多其他的特性。 因为它的诞生就是基于 分布式的理念(built with cloud in mind),你可以试一下 站点中的特性里面所列举的特性。
http://stackoverflow.com/q/1284083/445908
I've been using Solr successfully for almost 2 years now, and have never used Sphinx, so I'm obviously biased. However, I'll try to keep it objective by quoting the docs or other people. I'll also take patches to my answer :-)
过去两年我一直在用 Solr,用的很好。从没用过Sphinx. 所以我个人观点肯定不太客观。不过,我引用一下其他人的看法
Similarities: 相同点:
Both Solr and Sphinx satisfy all of your requirements. They're fast and designed to index and search large bodies of data efficiently.
两者都满足你的需求。它们都很快,面向于大数据量下的高效率的建立索引,搜索。
Both have a long list of high-traffic sites using them (Solr, Sphinx)
都有很长的大数据量网站列表
Both offer commercial support. (Solr, Sphinx)
都有商业支持。
Both offer client API bindings for several platforms/languages (Sphinx, Solr)
都支持 对不同语言的 CLIENT API。
Both can be distributed to increase speed and capacity (Sphinx, Solr)
都支持分布式。
Here are some differences: 几点不同:
Solr, being an Apache project, is obviously Apache2-licensed. Sphinx is GPLv2. This means that if you ever need to embed or extend (not just "use") Sphinx in a commercial application, you'll have to buy a commercial license (rationale)
Solr 是 apache的项目,是apache2的license. Sphinx是 GPL,也就是说,如果你想把Sphinx放到某个商业性的项目中,你就得买个商业许可证。
Solr is easily embeddable in Java applications.
Solr很容易就可以集成到JAVA项目中。
Solr is built on top of Lucene, which is a proven technology over 8 years old with a huge user base (this is only a small part). Whenever Lucene gets a new feature or speedup, Solr gets it too. Many of the devs committing to Solr are also Lucene committers.
Solr 是基于Lucene 的,后者已经8岁了,有着庞大的用户群体。Lucene 有啥功能,Solr就能享受到啥功能。而且Solr的 开发人员很多也参与了Lucene的开发。
Sphinx integrates more tightly with RDBMSs, especially MySQL.
Solr can be integrated with Hadoop to build distributed applications
Solr can be integrated with Nutch to quickly build a fully-fledged web search engine with crawler.
Sphinx 跟 RDBMS (特别是MYSQL) 绑定的特别紧密。 而且Solr 可以和 Hadoop 集成,成为分布式系统。 也可以 和 Nutch集成,成为一个功能完备的搜索引擎,以及网络爬虫(crawler)
Solr can index proprietary formats like Microsoft Word, PDF, etc. Sphinx can't.
Solr 可以检索 WORD, PDF。 Sphinx不行
Solr comes with a spell-checker out of the box.
Solr 还带有拼写检查器。
Solr comes with facet support out of the box. Faceting in Sphinx takes more work.
Solr 默认有facet支持。 而Shphinx中就得做一些额外的工作才行
Sphinx doesn't allow partial index updates for field data.
Sphinx 不支持针对field data 的partial index的更新
In Sphinx, all document ids must be unique unsigned non-zero integer numbers. Solr doesn't even require an unique key for many operations, and unique keys can be either integers or strings.
Sphinx中,所有的 document id 必须是 unique , unsigned, non-zero 整数(估计是用C语言的名词来解释)。 Solr的很多操作,甚至不需要unique key。 而且unique key 可以是整数,也可以是字符串。
Solr supports field collapsing (currently as an additional patch only) to avoid duplicating similar results. Sphinx doesn't seem to provide any feature like this.
Solr 支持field collapsing 来避免相似搜索结果的重复性。 Sphinx没这个功能。
While Sphinx is designed to only retrieve document ids, in Solr you can directly get whole documents with pretty much any kind of data, making it more independent of any external data store and it saves the extra roundtrip.
Sphinx只是查询document id, 而solr 则可以查询出整个的document.
Solr, except when used embedded, runs in a Java web container such as Tomcat or Jetty, which require additional specific configuration and tuning (or you can use the included Jetty and just launch it with java -jar start.jar). Sphinx has no additional configuration.
Solr 跑在 java web 容器中,例如Tomcat 或 Jetty. 所以我们就可以进行配置和调试,优化。 Sphinx 则没有额外的配置选项。
http://www.wikivs.com/wiki/Lucene_vs_Sphinx
有一点比较重要: sphinx不支持 live index update. 支持的话也非常有限。
有一个PPT,可以增加知识:
http://www.slideshare.net/billkarwin/practical-full-text-search-with-my-sql
- 浏览: 1878930 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
wangyudong:
Wisdom RESTClient工具地址更新了哦https: ...
前端模拟POST发送数据-Chrome下的REST Client(接口测试利器) -
wangyudong:
很多REST Client是不支持自动化测试RESTful A ...
前端模拟POST发送数据-Chrome下的REST Client(接口测试利器) -
higkoo:
一个非常棒的系统,要是能支持LDAP等开源认证就完美了。
Cynthia 是个问题管理/BUG管理/任务管理/项目管理系统。 -
寻光之旅:
标签库使用有啥好处呢?
thinkphp 使用标签库的步骤 -
lgdjy123:
Android:TextView属性大全
发表评论
-
linux回到上次目录与历史命令查找快捷方式
2019-06-20 10:27 901一、回到上次操作的目录# cd -进入上次访问目录二、历史命令 ... -
mac iterm2 rz命令安装
2016-11-08 11:17 1516安装配置 安装lrzsz 使用 brew i ... -
phpdocument的使用
2016-10-25 16:24 636官网: https://www.phpdoc.org/ ... -
Linux命令的组成规则及其全拼单词
2016-10-14 09:14 953########################### ... -
angularjs调用两次的原因
2015-11-09 17:44 3529AngularJS 标签: angularjs javas ... -
linux: no space left
2015-11-06 19:36 756发现在 /var/lib/docker/volumnes ... -
docker空间不足 Unable to open the database file: unable to open database fi
2015-10-23 11:53 1937命令行报错如下: Unable to open the d ... -
请成员加入本地环境安装
2015-10-23 11:31 0----------------------------本地 ... -
git subtree用法
2015-10-15 18:33 1063来源于:http://aoxuis.me/posts/20 ... -
mac 上安装与卸载docker
2015-10-15 10:52 46841.安装Docker: 1.1 brew update ... -
Git全局配置和单个仓库的用户名邮箱配置
2015-08-28 09:57 1250学习git的时候, 大家刚开始使用之前都配置了一个全局的用 ... -
phpstorm安装及配置vim插件
2015-08-09 10:22 1096用这个写网页代码是比较爽的,当然还有很多优秀的软件。 ... -
mac,phpstorm+vagrant+xdebug
2015-08-07 16:57 989参考地址: http://my.oschina.n ... -
在Nginx中加Basic认证
2015-08-04 17:22 601#1. 新建一个pw.pl文件专门用来生成密码#!/usr ... -
mac下面的科学计算器
2015-07-16 17:03 765打开计算器, 按Command+1,2,3 -
keepalive+haproxy实验
2015-07-07 23:05 973平台: Mac 工具: Vagrant 系统: CentOS6 ... -
Centos6.5使用yum安装mysql——快速上手必备
2015-07-06 19:47 928第1步、yum安装mysql[root@stonex ~] ... -
MAC下切换到zsh,打造有git提示的美化shell
2015-07-06 11:51 1605下载 ohmyzsh: git clone git: ... -
mac工作软件推荐
2015-07-06 11:36 910mac上的Terminal + bash + screen组 ... -
基于vagrant的redis主从实验
2015-07-05 14:04 1277平台: Mac 工具: Vagrant ...
相关推荐
本文还对比了Elasticsearch与其他现代搜索引擎技术,如Solr、Sphinx和Azure Search。这种比较有助于读者更好地理解哪种技术更适合自己的需求。例如,Solr虽然也是基于Lucene构建的,但在某些方面(如集群管理和可...
- **Elasticsearch**:基于Lucene构建,提供更高级的功能和易于使用的RESTful API,适合分布式环境下的大数据量搜索。 - **Solr**:也是基于Lucene,提供了更多的企业级特性,如集群管理和高可用性支持。 - **其他...
在本案例中,提到了几种不同的搜索引擎选项,包括Elasticsearch、Sphinx、Lucene/Solr、Redisearch、Bleve/Groonga以及PostgreSQL的全文搜索功能。这些引擎各有特点,例如Elasticsearch因其分布式、高可用性、丰富的...
service的API接口Lucene - Lucene是一个开放源代码的全文检索引擎工具包Sphinx - Sphinx是一个基于SQL的全文检索引擎Elasticsearch 权威指南工具在线生成工具在线工具合集 - 集成了很多好用的在线工具Bejson - 在线 ...
除了上述三种方案,其他分布式搜索方案还包括Elasticsearch和Sphinx等。Elasticsearch是另一款流行的分布式搜索引擎,以其易于使用和强大的全文搜索功能著称,支持自动的负载均衡和故障恢复。Sphinx则是一个高性能的...
- **Solr**、**Elasticsearch**、**Zoie**、**BoCo**等:基于Lucene开发的搜索引擎解决方案,各有特色。 - **Sphinx**:一款高性能的全文检索引擎,适用于大数据量的实时搜索。 - **Xapian**:一种高度可扩展的全文...
1. **Elasticsearch**:Elasticsearch是最流行的开源搜索引擎之一,基于Lucene库开发,提供分布式、实时的搜索和分析引擎。它支持多种数据类型,包括文本、数值、地理位置等,并且具有强大的聚合分析能力。 2. **...
- **Elasticsearch**:同样基于Lucene,但更侧重于分布式环境下的大数据搜索和分析。 #### 十、总结 通过对Lucene 3.0的介绍和关键知识点的解析,我们可以看出全文检索技术在现代信息检索领域的重要性。Lucene ...
- **站内搜索引擎**:如Sphinx、Lucene、ElasticSearch、Solr,用于特定网站内部信息的快速检索。 **技术实现** - **编程语言**:常见用于全文搜索的编程语言包括PHP、Python、Golang、C/C++、Java等。 - **数据...
- **Lucene、Solr、ElasticSearch、Sphinx、CoreSeek**:为APP提供高效的搜索功能。 12. **运维**: - **Linux、Nginx、MySQL、Redis、MongoDB**:运维过程中常用的工具和数据库。 - **Docker**:构建和维护一致...
- 搜索引擎原理,如Lucene、Elasticsearch、Solr、sphinx的工作机制。 10. **性能**: - 性能优化方法论、容量评估、CDN网络、连接池和性能调优。 11. **大数据**: - 流式计算框架如Storm、Flink、Kafka ...
- **Elasticsearch**:后来逐渐成为主流选择,具备高扩展性和实时搜索能力。 - **中文分词**:采用MMseg进行中文文本处理,提高搜索精准度。 - **倒排索引**:通过建立倒排索引来加速文档检索速度,减少磁盘I/O操作...
- **Elasticsearch**:高度可扩展的实时搜索和分析引擎。 - **Solr**:基于Lucene的高性能搜索平台。 - **Lunr.js**:浏览器端的文本搜索库。 - **Compass**:Java搜索引擎。 2. **专业搜索库**: - **Lucene*...