Lucene with PHP

2019-01-11 09:46发布

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

标签: php lucene
6条回答
时光不老,我们不散
2楼-- · 2019-01-11 10:03

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

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).

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

查看更多
Summer. ? 凉城
3楼-- · 2019-01-11 10:13

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!

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

查看更多
再贱就再见
4楼-- · 2019-01-11 10:16

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

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.

查看更多
Explosion°爆炸
5楼-- · 2019-01-11 10:18

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.

查看更多
来,给爷笑一个
6楼-- · 2019-01-11 10:25

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.

查看更多
We Are One
7楼-- · 2019-01-11 10:28

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

No need for zend framework, just native php

查看更多
登录 后发表回答