Example #1
0
 /**
  * Do the actual search and return results
  *
  * @param Query $search  search object
  * @param int $start     [optional] starting record number
  * @param int $max       [optional] max records
  * @param string $sort   [optional] sort order
  * @param bool $facets   [optional] whether to include facets
  *
  * @return Results
  */
 protected function doSearch(Query $query, $start = 1, $max = 10, $sort = "", $facets = true)
 {
     // can't search on this field, so return 0
     if ($this->query->hasUnsupportedField()) {
         $results = new ResultSet($this->getConfig());
         $results->total = 0;
         return $results;
     }
     // get the query
     $request = $query->getQueryUrl();
     // get the data
     $client = Factory::getHttpClient();
     $response = $client->getUrl($request->url, null, $request->headers);
     return $this->parseResponse($response);
 }