全文搜索引擎对比——Lucene、Sphinx、Postgresql、MySQL? [英] Comparison of full text search engine - Lucene, Sphinx, Postgresql, MySQL?

查看:42
本文介绍了全文搜索引擎对比——Lucene、Sphinx、Postgresql、MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个 Django 站点,我正在寻找一个搜索引擎.

I'm building a Django site and I am looking for a search engine.

一些候选人:

  • Lucene/Lucene with Compass/Solr

  • Lucene/Lucene with Compass/Solr

狮身人面像

Postgresql 内置全文搜索

Postgresql built-in full text search

MySQl 内置全文搜索

MySQl built-in full text search

选择标准:

  • 结果相关性和排名
  • 搜索和索引速度
  • 易于使用且易于与 Django 集成
  • 资源要求 - 网站将托管在 VPS 上,因此理想情况下,搜索引擎不会t 需要大量 RAM 和 CPU
  • 可扩展性
  • 额外功能,例如您的意思是?"、相关搜索等
  • result relevance and ranking
  • searching and indexing speed
  • ease of use and ease of integration with Django
  • resource requirements - site will be hosted on a VPS, so ideally the search engine wouldn't require a lot of RAM and CPU
  • scalability
  • extra features such as "did you mean?", related searches, etc

任何使用过上述搜索引擎或不在列表中的其他引擎的人 -- 我很想听听您的意见.

Anyone who has had experience with the search engines above, or other engines not in the list -- I would love to hear your opinions.

至于索引需求,随着用户不断向站点输入数据,这些数据需要不断地被索引.它不一定是实时的,但理想情况下,新数据会出现在索引中,延迟不超过 15 - 30 分钟

As for indexing needs, as users keep entering data into the site, those data would need to be indexed continuously. It doesn't have to be real time, but ideally new data would show up in index with no more than 15 - 30 minutes delay

推荐答案

很高兴看到有人对 Lucene 表示赞同 - 因为我不知道这一点.

Good to see someone's chimed in about Lucene - because I've no idea about that.

Sphinx,另一方面,我很清楚,所以让我们看看是否能帮上忙.

Sphinx, on the other hand, I know quite well, so let's see if I can be of some help.

  • 结果相关性排名是默认设置.您可以根据需要设置自己的排序,并为特定字段赋予更高的权重.
  • 索引速度非常快,因为它直接与数据库对话.任何缓慢都来自复杂的 SQL 查询和未索引的外键以及其他此类问题.我也从未发现搜索有任何缓慢.
  • 我是一个 Rails 人,所以我不知道用 Django 实现它有多么容易.不过,Sphinx 源代码附带了一个 Python API.
  • 搜索服务守护进程 (searchd) 的内存使用量非常低 - 您可以对 索引器进程也使用了多少内存.
  • 可扩展性是我的知识比较粗略的地方 - 但是将索引文件复制到多台机器并运行多个 searchd 守护程序很容易.不过,我从其他人那里得到的总体印象是,它在高负载下非常好,因此不需要在多台机器上扩展它.
  • 不支持did-you-mean"等 - 尽管这些可以很容易地用其他工具完成.Sphinx 确实使用字典进行词干,因此驾驶"和驾驶"(例如)在搜索中会被视为相同.
  • Sphinx 不允许字段数据的部分索引更新.对此的常用方法是维护包含所有最近更改的 delta 索引,并在每次更改后重新索引(这些新结果会在一两秒内出现).由于数据量很小,这可能需要几秒钟的时间.不过,您仍然需要定期重新索引主数据集(尽管频率取决于数据的波动性 - 每天?每小时?).不过,快速的索引速度让这一切变得轻松自如.

我不知道这对你的情况有多适用,但是 Evan Weaver 比较了一些常见的 Rails 搜索选项(Sphinx、Ferret(Ruby 的 Lucene 端口)和 Solr),并运行了一些基准测试.可能有用,我猜.

I've no idea how applicable to your situation this is, but Evan Weaver compared a few of the common Rails search options (Sphinx, Ferret (a port of Lucene for Ruby) and Solr), running some benchmarks. Could be useful, I guess.

我没有研究过 MySQL 全文搜索的深度,但我知道它在速度和功能方面都无法与 Sphinx、Lucene 或 Solr 竞争.

I've not plumbed the depths of MySQL's full-text search, but I know it doesn't compete speed-wise nor feature-wise with Sphinx, Lucene or Solr.

这篇关于全文搜索引擎对比——Lucene、Sphinx、Postgresql、MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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