first commit
This commit is contained in:
@@ -24,12 +24,10 @@ namespace WapplerSystems\Meilisearch\System\Meilisearch\Service;
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use WapplerSystems\Meilisearch\Domain\Search\Query\Query;
|
||||
use WapplerSystems\Meilisearch\System\Meilisearch\ResponseAdapter;
|
||||
use WapplerSystems\Meilisearch\System\Meilisearch\MeilisearchCommunicationException;
|
||||
use WapplerSystems\Meilisearch\System\Meilisearch\MeilisearchInternalServerErrorException;
|
||||
use WapplerSystems\Meilisearch\System\Meilisearch\MeilisearchUnavailableException;
|
||||
use Solarium\Exception\HttpException;
|
||||
|
||||
/**
|
||||
* Class MeilisearchReadService
|
||||
@@ -47,26 +45,6 @@ class MeilisearchReadService extends AbstractMeilisearchService
|
||||
*/
|
||||
protected $responseCache = null;
|
||||
|
||||
/**
|
||||
* Performs a search.
|
||||
*
|
||||
* @param Query $query
|
||||
* @return ResponseAdapter Meilisearch response
|
||||
* @throws \RuntimeException if Meilisearch returns a HTTP status code other than 200
|
||||
*/
|
||||
public function search($query)
|
||||
{
|
||||
try {
|
||||
$request = $this->client->createRequest($query);
|
||||
$response = $this->executeRequest($request);
|
||||
$this->hasSearched = true;
|
||||
$this->responseCache = $response;
|
||||
} catch (HttpException $e) {
|
||||
$this->handleErrorResponses($e);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a search has been executed or not.
|
||||
*
|
||||
|
Reference in New Issue
Block a user