diff --git a/code/DocumentationSearch.php b/code/DocumentationSearch.php index f8b95a8..ac63fe1 100755 --- a/code/DocumentationSearch.php +++ b/code/DocumentationSearch.php @@ -198,7 +198,7 @@ class DocumentationSearch { public function performSearch() { try { $index = Zend_Search_Lucene::open(self::get_index_location()); - + Zend_Search_Lucene::setResultSetLimit(100); $query = new Zend_Search_Lucene_Search_Query_Boolean(); @@ -214,7 +214,7 @@ class DocumentationSearch { $query->addSubquery($moduleQuery, true); } - + if($this->versions) { $versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm(); @@ -229,7 +229,6 @@ class DocumentationSearch { error_reporting('E_ALL ^ E_NOTICE'); $this->results = $index->find($query); error_reporting($er); - $this->totalResults = $index->numDocs(); } catch(Zend_Search_Lucene_Exception $e) { diff --git a/code/controllers/DocumentationViewer.php b/code/controllers/DocumentationViewer.php index f4fab56..05c0aa4 100755 --- a/code/controllers/DocumentationViewer.php +++ b/code/controllers/DocumentationViewer.php @@ -821,14 +821,14 @@ class DocumentationViewer extends Controller { new HiddenField('Entities', '', implode(',', array_keys($this->getSearchedEntities()))), new HiddenField('Versions', '', implode(',', $this->getSearchedVersions())) ); - + $actions = new FieldList( new FormAction('results', 'Search') ); - + $form = new Form($this, 'DocumentationSearchForm', $fields, $actions); $form->disableSecurityToken(); - $form->setFormMethod('get'); + $form->setFormMethod('GET'); $form->setFormAction(self::$link_base . 'DocumentationSearchForm'); return $form; @@ -842,7 +842,7 @@ class DocumentationViewer extends Controller { function getSearchedEntities() { $entities = array(); - if(isset($_REQUEST['Entities'])) { + if(!empty($_REQUEST['Entities'])) { if(is_array($_REQUEST['Entities'])) { $entities = Convert::raw2att($_REQUEST['Entities']); } @@ -866,7 +866,7 @@ class DocumentationViewer extends Controller { function getSearchedVersions() { $versions = array(); - if(isset($_REQUEST['Versions'])) { + if(!empty($_REQUEST['Versions'])) { if(is_array($_REQUEST['Versions'])) { $versions = Convert::raw2att($_REQUEST['Versions']); $versions = array_combine($versions, $versions); @@ -900,7 +900,7 @@ class DocumentationViewer extends Controller { */ function results($data, $form = false) { $query = (isset($_REQUEST['Search'])) ? $_REQUEST['Search'] : false; - + $search = new DocumentationSearch(); $search->setQuery($query); $search->setVersions($this->getSearchedVersions()); @@ -959,7 +959,7 @@ class DocumentationViewer extends Controller { $form = new Form($this, 'AdvancedSearchForm', $fields, $actions, $required); $form->disableSecurityToken(); - $form->setFormMethod('get'); + $form->setFormMethod('GET'); $form->setFormAction(self::$link_base . 'DocumentationSearchForm'); return $form;