/**
  * Past straight to results, display and encode the query.
  */
 public function getSearchResults()
 {
     $query = $this->getSearchQuery();
     $search = new DocumentationSearch();
     $search->setQuery($query);
     $search->setVersions($this->getSearchedVersions());
     $search->setModules($this->getSearchedEntities());
     $search->setOutputController($this->owner);
     return $search->renderResults();
 }
 /**
  * Performs the search against the documentation in the system
  * @param {string} $keywords Keywords to search for
  * @param {int} $startIndex Start index for pagination
  * @return {ArrayData} Array Data of information about the results
  * 
  * @see ICMSUserDocsSearchEngine::getSearchResults()
  */
 public function getSearchResults($keywords, $startIndex = 0, SS_HTTPRequest $request = null)
 {
     //Workaround to set the search index location
     Config::inst()->update('DocumentationSearch', 'index_location', self::config()->index_location);
     //Search the index
     $search = new DocumentationSearch();
     $search->setQuery($keywords);
     $search->setVersions(array());
     $search->setModules(array());
     $search->performSearch();
     return $search->getSearchResults($request);
 }
コード例 #3
0
 /**
  * Past straight to results, display and encode the query
  */
 function results($data, $form = false)
 {
     $query = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : false;
     if (!$query) {
         return $this->httpError('404');
     }
     $search = new DocumentationSearch();
     $search->setQuery($query);
     $search->setOutputController($this);
     return $search->renderResults();
 }