optimize retrieve logic

This commit is contained in:
team 1
2026-04-14 13:04:41 +02:00
parent 7caf6b5354
commit bf0b58fdea

View File

@@ -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) {