first commit

This commit is contained in:
Sven Wappler
2021-04-24 04:44:44 +02:00
parent cadcc8edb4
commit 2c9e27b3b7
55 changed files with 333 additions and 3877 deletions

View File

@@ -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.
*