我目前正在寻找其他搜索方法,而不是有一个巨大的SQL查询。 我最近看了elasticsearch,玩了一下whoosh(一种搜索引擎的Python实现)。
你能给出你的选择的理由吗?
我目前正在寻找其他搜索方法,而不是有一个巨大的SQL查询。 我最近看了elasticsearch,玩了一下whoosh(一种搜索引擎的Python实现)。
你能给出你的选择的理由吗?
当前回答
我们经常使用Lucene来索引和 搜索数千万份文件。 搜索足够快,而且我们用 不执行的增量更新 很长一段时间。我们确实花了一些时间 来这里。的优点 Lucene是它的可扩展性,很大 功能范围和活动范围 开发者社区。使用裸 Lucene需要用Java编程。
如果你要重新开始,在Lucene家族中适合你的工具是Solr,它比裸Lucene更容易设置,并且几乎拥有Lucene的所有功能。它可以很容易地导入数据库文档。Solr是用Java编写的,因此对Solr的任何修改都需要Java知识,但是仅通过调整配置文件就可以完成很多工作。
我也听说过Sphinx的优点,特别是与MySQL数据库的结合。不过还没有用过。
在我看来,你应该根据以下几点来选择:
The required functionality - e.g. do you need a French stemmer? Lucene and Solr have one, I do not know about the others. Proficiency in the implementation language - Do not touch Java Lucene if you do not know Java. You may need C++ to do stuff with Sphinx. Lucene has also been ported into other languages. This is mostly important if you want to extend the search engine. Ease of experimentation - I believe Solr is best in this aspect. Interfacing with other software - Sphinx has a good interface with MySQL. Solr supports ruby, XML and JSON interfaces as a RESTful server. Lucene only gives you programmatic access through Java. Compass and Hibernate Search are wrappers of Lucene that integrate it into larger frameworks.
其他回答
Lucene很好,但是他们的停止词集很糟糕。我不得不手动向StopAnalyzer添加大量的停止词。ENGLISH_STOP_WORDS_SET使它接近可用。
我没有使用过Sphinx,但我知道人们对它的速度和近乎神奇的“易于设置与令人惊叹”的比率深信不疑。
我用过Sphinx、Solr和Elasticsearch。Solr/Elasticsearch是建立在Lucene之上的。它增加了许多常见的功能:web服务器api, faceting,缓存等。
如果您只想要一个简单的全文搜索设置,Sphinx是一个更好的选择。
如果你想定制你的搜索,Elasticsearch和Solr是更好的选择。它们是非常可扩展的:您可以编写自己的插件来调整结果评分。
一些用法示例:
斯芬克斯:craigslist.org 索尔:Cnet, Netflix, digg.com Elasticsearch: Foursquare, Github
indextank试试。
在弹性搜索的情况下,它被认为比lucene/solr更容易使用。它还包括非常灵活的评分系统,可以在没有评分的情况下调整。
我们经常使用Lucene来索引和 搜索数千万份文件。 搜索足够快,而且我们用 不执行的增量更新 很长一段时间。我们确实花了一些时间 来这里。的优点 Lucene是它的可扩展性,很大 功能范围和活动范围 开发者社区。使用裸 Lucene需要用Java编程。
如果你要重新开始,在Lucene家族中适合你的工具是Solr,它比裸Lucene更容易设置,并且几乎拥有Lucene的所有功能。它可以很容易地导入数据库文档。Solr是用Java编写的,因此对Solr的任何修改都需要Java知识,但是仅通过调整配置文件就可以完成很多工作。
我也听说过Sphinx的优点,特别是与MySQL数据库的结合。不过还没有用过。
在我看来,你应该根据以下几点来选择:
The required functionality - e.g. do you need a French stemmer? Lucene and Solr have one, I do not know about the others. Proficiency in the implementation language - Do not touch Java Lucene if you do not know Java. You may need C++ to do stuff with Sphinx. Lucene has also been ported into other languages. This is mostly important if you want to extend the search engine. Ease of experimentation - I believe Solr is best in this aspect. Interfacing with other software - Sphinx has a good interface with MySQL. Solr supports ruby, XML and JSON interfaces as a RESTful server. Lucene only gives you programmatic access through Java. Compass and Hibernate Search are wrappers of Lucene that integrate it into larger frameworks.
我们在垂直搜索项目中使用Sphinx,有10.000.000 + MySql记录和10+不同的数据库。 它对MySQL有非常出色的支持,索引性能高,研究速度快,但可能不如Lucene。 但是,如果你每天都需要快速索引并使用MySQL数据库,这是正确的选择。