/**
  * This method returns true when the last search was exectued with an empty query
  * string or whitspaces only. When no search was triggered it will return false.
  *
  * @return bool
  */
 public function getLastSearchWasExecutedWithEmptyQueryString()
 {
     $wasEmptyQueryString = false;
     if ($this->lastResultSet != null) {
         $wasEmptyQueryString = $this->lastResultSet->getUsedSearchRequest()->getRawUserQueryIsEmptyString();
     }
     return $wasEmptyQueryString;
 }
Example #2
0
 /**
  * Retrieves the list of commands to process for the results view.
  *
  * @return array An array of command names to process for the result view
  */
 protected function getCommandList()
 {
     $requirements = PluginCommand::REQUIREMENT_NONE;
     $commandList = array();
     if ($this->getSearchResultSetService()->getHasSearched()) {
         $requirements = PluginCommand::REQUIREMENT_HAS_SEARCHED;
         if ($this->searchResultSet->getUsedSearch()->getNumberOfResults() > 0) {
             $requirements += PluginCommand::REQUIREMENT_HAS_RESULTS;
         } else {
             $requirements += PluginCommand::REQUIREMENT_NO_RESULTS;
         }
     }
     $commandList = CommandResolver::getPluginCommands('results', $requirements);
     return $commandList;
 }
 /**
  * This method is used to reference the SearchResult object from the response in the SearchResultSet object.
  *
  * @param \Apache_Solr_Response $response
  * @param SearchResultSet $resultSet
  */
 protected function addSearchResultsToResultSet($response, $resultSet)
 {
     if (!is_array($response->response->docs)) {
         return;
     }
     foreach ($response->response->docs as $searchResult) {
         $resultSet->addSearchResult($searchResult);
     }
 }