Version 5, last updated by Marcin Domanski at Aug 18 15:40 2008 UTC

Space tags: cakephp  behaviors 

Some notes: * PHP5 only (like Zend_Search_Lucene)

  • i STRONGLY encourage to read Zend_Search_Lucene docs before atempting do understand the code (at least read it once :)

  • config/lucene.php holds the configuration data for lucene, what data to index etc

  • you have to build the initial index with the shell ( cake search build_index)

  • you might have problems with permissions - Zend_Search_Lucene is very picky about them - just chmod -r the index dir and delete the .lock. files from index ( default - app/tmp/search_index)

  • to seach use $this->Model->search($query, $limit, $page)

  • after the search you can get the number of hit by using $this->Model->hits_count()

  • you can also get the terms used in the search with $this->Model->terms();

  • you want the paginator to work ? check PaginatorCheating

  • in the plugin there is a SearchHelper that highlights the search results

:wq