PHP: Zend Framework PHP implemention of Lucene or Solr for a API service?
-
I need of indexing a lot of data (mostly text). We offer these data in API mode (LAMP platform with PHP / MySQL) and exchange data in json format. I would like to use Solr search server, but I know that there is also an implementation of Lucene in the Zend PHP Framework. Anyone have experience with Solr or Lucene in the Zend PHP Framework? The goal is to obtain the best possible performance with fulltext queries type (database = around 1M records)
-
Answer:
Use Solr. The Lucene implementation in ZF is okay for small sets of data, but not nearly as performant as the original Java implementation. Solr uses the Java implementation, and adds a bunch of features around it, of which caching will be quite important to your needs.
Matthew Weier O'Phinney at Quora Visit the source
Other answers
The latest versions of Solr already start to provide PHP response format http://wiki.apache.org/solr/SolPHP#Solr.27s_PHP_response_format, which is ignored by many developers. According this test http://www.raspberry.nl/2012/02/28/benchmarking-php-solr-response-data-handling/, it's the easiest and efficient way to connect PHP with Solr. You just need several lines PHP codes like this. $serializedResult = file_get_contents('http://localhost:8983/solr/select?q=iPod&wt=phps'); $result = unserialize($serializedResult); print_r($result);
Liang Shen
At Magento we ran a few tests with the ZF implementation and found that performance was not good on medium to large data sets.
Yoav Kutner
Related Q & A:
- How to deal with timeout when accessing a web service?Best solution by Stack Overflow
- How to call a web service using HttpWebRequest?Best solution by Stack Overflow
- how to consume a web service in mule flow?Best solution by Stack Overflow
- How to connect to a WCF Service?Best solution by Stack Overflow
- Where can I find a good guide for a civil service exam?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.