Zend_Search_Lucene vs SOLR(Zend_Search_Lucene 与 SOLR)
问题描述
我最近偶然发现了 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 需要在 Web 托管中运行 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 容器(可以是 Tomcat、Jetty 或其他几个此类程序之一)内的独立服务器 web 应用程序运行.设置 Solr 服务器比设置 Lucene 应用程序要容易得多.您可以使用 Solr 做很多事情,而无需编写一行 Java 代码——只需调整一些 XML 配置文件.设置 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Zend_Search_Lucene 与 SOLR
基础教程推荐
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- PHP 守护进程/worker 环境 2022-01-01
- HTTP 与 FTP 上传 2021-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01