/**
  * Send a email
  *
  * @param SearchRequestWasPosted $event
  */
 public function notify(SearchRequestWasPosted $event)
 {
     // Only send a mail when there were results
     if ($this->resultRepository->hasResults($event->search()->getQuery())) {
         $this->message->setArguments(array_merge($event->request()->toArray(), $event->search()->toArray()));
         $this->message->render();
         $this->mailDispatcher->send($this->message);
     }
 }
 /**
  * Get the results for a given search string. DEPRECATED, use POST api/searches instead
  *
  * @ApiDoc(
  * requirements={
  *      {
  *          "name"="_format",
  *          "dataType"="string",
  *          "requirement"="json|xml",
  *          "description"="Response format",
  *      },
  *      {
  *          "name"="queryString",
  *          "dataType"="string",
  *          "requirement"="double urlencoded base64 string (urlencode(urlencode(base64_encode($queryString)))",
  *          "description"="Search string"
  *      }
  *  },
  * deprecated = true,
  * )
  *
  * @param $queryString // Encoding of the string happens in the RESTControllerListener
  * @return array
  * @View()
  */
 public function getResultsAction($queryString)
 {
     // Find all results for this queryString
     $results = $this->resultRepository->all($queryString);
     return ['results' => $results];
 }