PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Creating A Fulltext Search Engine In PHP 5 With The Zend Framework's Zend Search Lucene

Article Comments (8 total)

Nikhil, 16 April 7691
Is there any way to Index Office 2003 documents. Or is there any paser for the same.

syakur, 6 February 2009
i have error like this: Fatal error: Call to undefined function getalldocuments() in C:\xampp\htdocs\list1.php on line 9 whats the problem?

Tairik Jean da Costa, 4 February 2009
Hi, very good article, but what about pagination? How can I do it without Zend_Paginator? Tks.

suhail, 19 September 2008
Hi, informative article, one thing which is missing in this article is the paging. you have tell about the limiting records, but how can i implement paging in zend search lucene. Your comment is awaiting moderation.

desmond, 30 July 2008
Hi, how to search the document which is stored in database? let say my document is resume.

Tim Anderson, 1 November 2007

is it possible to customize the Zend_Search_Lucene scoring algorithm so it works more like this script: http://www.iamcal.com/publish/articles/php/search? Each one of my index entries only contains on average 5-6 words. The default behavior of Zend_Search_Lucene has a very hard time with small amounts of text.

For example, if I have index entries of: Red Hook Pilsner Samuel Adams Pilsner Sierra Nevada Pilsner Widmer Pilsner and i search for "Red Hook Pilsner" chances are I'll get one of the other entries like "Widmer Pilsner" as my first result. i just want the engine to work based on the principle of mysql RLIKE matches. is this possible?


scan, 10 August 2006

Hi, I want to know whether the Zend Framework is able to index and search txt, pdf, xml, doc files stored on the server?

Response from PhpRiot:

Yes, as mentioned in the article you will need to write a custom text analyzer, as per the instructions at http://framework.zend.com/manual/en/zend.search.lucene.extending.html


jefftulsa, 3 June 2006

This is a helpful article to get started. In playing around with this search tool, I ran into a PHP Fatal error when trying to load large amounts of data (actually, not all that much data, but around 200,000 varchar(100) text fields): Allowed memory size of xxxx bytes exhausted (tried to allocated 119 bytes) in Zend/Search/Lucene/Analysis/Analyzer/Common/Text.php on line 65. I am curious if there are any known restrictions on the amount of data you can use withe the Lucene search?

Response from PhpRiot:

The use of Zend_Search_Lucene is subject to the normal memory limits associated with PHP. You can change these limits by changing the memory_limit value in your php.ini file.

Submit a Comment
Use the following form to submit a comment for this article. You can include any required code snippets, which we will format and highlight accordingly.


Note: Before your comment appears on PhpRiot, it must be manually approved. The email address field is optional. If you choose to include it, it will be displayed obfuscated to protect it from spammers.

In This Article


Article History

Apr 27, 2006
Initial article version
Dec 17, 2007
Updated to use Zend Framework 1.0.3