Lucene 与 PHP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2010663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:40:28  来源:igfitidea点击:

Lucene with PHP

phplucene

提问by saturngod

Can I use Lucene with PHP ? I don't want to use Zend. Can I use in native PHP (not framework) ?

我可以在 PHP 中使用 Lucene 吗?我不想使用 Zend。我可以在原生 PHP(不是框架)中使用吗?

采纳答案by pix0r

I would recommend using Apache SOLRas your Lucene backend and connecting via web service calls from your PHP code.

我建议使用Apache SOLR作为您的 Lucene 后端,并通过来自您的 PHP 代码的 Web 服务调用进行连接。

I'd also note that it's easy to pick and choose components of Zend Framework for use in your application without loading the entire framework. You could use Zend_Search_Lucene in your site and forego Zend's MVC, database, and related components.

我还注意到,在不加载整个框架的情况下,挑选和选择 Zend Framework 的组件以在您的应用程序中使用是很容易的。您可以在您的站点中使用 Zend_Search_Lucene 并放弃 Zend 的 MVC、数据库和相关组件。

回答by gahooa

Also worth noting, SOLR (http://lucene.apache.org/solr/)has a simple HTTP API, and is built on top of Lucene, so if it provides what you need, then that's an easy answer!

同样值得注意的是,SOLR (http://lucene.apache.org/solr/)有一个简单的 HTTP API,并且建立在 Lucene 之上,所以如果它提供了您需要的东西,那么这是一个简单的答案!

I don't have direct experience with Lucene with PHP, so I'll defer to the experts on that.

我没有直接使用 Lucene 和 PHP 的经验,所以我会听从专家的意见。

回答by Jason K.

I recommend apache SOLR and then use php extension for solr. http://php.net/manual/en/book.solr.php

我推荐 apache SOLR,然后为 solr 使用 php 扩展。 http://php.net/manual/en/book.solr.php

No need for zend framework, just native php

不需要zend框架,只需要原生php

回答by Gnuffo1

When you say you don't want to use Zend, I'm assuming you mean you don't want to use the whole Zend Framework. Well you don't have to - the individual Zend components can be used on their own without needing to be part of a Zend framework project.

当您说您不想使用 Zend 时,我假设您的意思是您不想使用整个 Zend 框架。好吧,您不必 - 可以单独使用各个 Zend 组件,而无需成为 Zend 框架项目的一部分。

回答by Sebastian Mayer

I'm using Lucene with PHP doing system calls on Java, for example:

我正在使用 Lucene 和 PHP 在 Java 上进行系统调用,例如:

java ... .SearchFiles -index C:\shop\system\index -high -queries Computer* 

I have adapted SearchFiles to produce HTML code but the output may as well be dynamic PHP code (for example an array holding the search results).

我已经修改了 SearchFiles 来生成 HTML 代码,但输出也可能是动态 PHP 代码(例如保存搜索结果的数组)。

The system is very fast and you don't need more than Java on the server.

系统速度非常快,您只需要服务器上的 Java 即可。

回答by myk.

Yeah you can simply code a java module for indexing and searching purpose using apache lucene library. Then you can merge it with php module with php/java bridge or SOAP. It will be quite good learning experience for you.

是的,您可以使用 apache lucene 库简单地编写用于索引和搜索目的的 java 模块。然后你可以将它与带有 php/java 桥或 SOAP 的 php 模块合并。这对你来说将是一个很好的学习经历。