optimize retrieve logic
This commit is contained in:
@@ -34,9 +34,11 @@ final readonly class ShopSearchService
|
|||||||
if (!$this->enabled) {
|
if (!$this->enabled) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = [];
|
$response = [];
|
||||||
$query = $this->queryParser->parse($originalPrompt, $commerceIntent);
|
$query = $this->queryParser->parse($originalPrompt, $commerceIntent);
|
||||||
$criteria = $this->criteriaBuilder->build($query, $this->maxResults);
|
$criteria = $this->criteriaBuilder->build($query, $this->maxResults);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $this->storeApiClient->searchProducts($criteria);
|
$response = $this->storeApiClient->searchProducts($criteria);
|
||||||
} catch (ClientExceptionInterface|DecodingExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $e) {
|
} catch (ClientExceptionInterface|DecodingExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user