I want to cache my results from Zend_Lucene_Search using Zend_Paginator::setCache()
I get the following error:
Warning: fseek() expects parameter 1 to be resource, integer given
Here is the portion of code:
// Load index
$index = Zend_Search_Lucene::open(APPLICATION_PATH . '/indexes');
// Paginate
$paginator = Zend_Paginator::factory($index->find($query));
$paginator->setCache($this->_cache);
$paginator->setItemCountPerPage($items);
$paginator->setCurrentPageNumber($page);
// Send to view
$this->view->hits = $paginator;
In other areas of the site where I use the same technique to cache paginated results that are not from Zend_Lucene_Search, this works fine.
I read somewhere that storing results in a session or cache destroys the lucene document and that you have to convert the QueryHit objects to stdClass objects, but how? Does this work?