Zend_Search_Lucene is a good way to get search into a site relatively quickly. It’s based on Apache’s Lucene search and it’s a free alternative to getting a google applicance or something like that. One thing it’s lacked for a long time was the ability to search multiple indices (though Apache Lucene supported this Zend_Search_Lucene didn’t). In the release of ZF 1.8 it’s pointed out that this feature was now availble but I was unable to find any mention of how to use it in the document (at the time of this writing). After some detective work I found something on github that lead me to the code in the library that lead me to undertand how to use this:
require_once 'Zend/Search/Lucene/MultiSearcher.php';
$index = new Zend_Search_Lucene_Interface_MultiSearcher();
$index->addIndex(Zend_Search_Lucene::open('search/index1'));
$index->addIndex(Zend_Search_Lucene::open('search/index2'));
$index->find('someSearchQuery');
NB it doesn’t follow PEAR syntax so won’t work with Zend_Loader::loadClass. I expect there will be more updates to the documentation for this gem.




