Creating A Fulltext Search Engine In PHP 5 With The Zend Framework's Zend Search Lucene
Article Comments (8 total)
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?
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
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.




