问题描述
我很遗憾地跌入了Lucene项目的Zend Lucene港口.我对SOLR有一点经验,所以我想知道两者之间的区别是什么,尤其是在性能和安装方面.
I have recenlty stumbled into Zend Lucene port of Lucene project. I have a little bit experience with SOLR so I would like to know what is the difference between two of them especially from performance and installation side.
据我所知,SOLR要求Tomcat serverlet在虚拟主机中运行才能正常工作,那么Zend Lucene库又如何呢?
As much as I know SOLR requires Tomcat serverlet running in web hosting in order to work, what about Zend Lucene library?
我也有些困惑,这意味着在Lucene之上实现"?
I am also a bit confused what means "being implemented on the top of Lucene"?
推荐答案
Java Lucene及其所有其他语言(包括Zend Lucene)的移植都是搜索库.
Java Lucene, and all its ports to other languages, including Zend Lucene, are search libraries.
这意味着要使用Zend Lucene,您必须将其包装在其他(PHP)代码中,该代码会将搜索与应用程序的其余部分集成在一起.该代码通常需要管理Lucene的索引编制,检索以及通常的一些内务处理.您将使用PHP函数调用与Zend Lucene通信.
This means that in order to use Zend Lucene, you have to wrap it in other (PHP) code, that will integrate the search with the rest of your application. The code generally needs to manage indexing, retrieval and usually some housekeeping of Lucene. You communicate with Zend Lucene using PHP function calls.
Solr,OTOH,是基于Lucene构建的搜索服务器.这意味着Solr实例可以作为servlet容器内的独立服务器Web应用程序运行(可以是Tomcat,Jetty或其他几个此类程序之一).设置Solr服务器比使用Lucene应用程序容易得多.您只需编写一些XML配置文件即可使用Solr进行很多工作而无需编写任何Java代码.设置Solr服务器可能只需几分钟.与Solr进行通信的默认方式是使用HTTP调用.
Solr, OTOH, is a search server built on top of Lucene. This means that a Solr instance can run as a stand-alone server webapp inside a servlet container (That could be Tomcat, Jetty or one of several other such programs). It is much easier to set up a Solr server than a Lucene application. You can do a lot with Solr without writing a single line of Java - just by tweaking some XML configuration files. Setting up a Solr server may take as few as several minutes. The default way to communicate with Solr is using HTTP calls.
因此,基本上,Zend Lucene的安装需要具有PHP服务器,并使用PHP库进行正确的索引和检索. Solr安装需要运行Java servlet容器并将war文件部署到其中.
So basically Zend Lucene installation requires having a PHP server and proper indexing and retrieval using a PHP library. Solr installation requires running a Java servlet container and deploying a war file into it.
关于性能,Solr具有许多优化的Lucene缓存和其他参数.另外,我相信Zend Lucene的速度要比Java Lucene慢,所以我敢打赌Solr会更快,但这确实取决于特定的应用程序.
Regarding performance, Solr has many of Lucene caching and other parameters optimized. Also, I believe Zend Lucene is slower than Java Lucene, so my bet is that Solr would be faster, but this really depends on the specific application.
这篇关于Zend_Search_Lucene和SOLR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!