Skip to content

Commit 498fb80

Browse files
committed
MAGETWO-94172: ElasticSearch 5.0+ exception is shown if customer searches product before reindexing.
Fix identation.
1 parent e20d1ac commit 498fb80

File tree

1 file changed

+3
-2
lines changed
  • app/code/Magento/Elasticsearch/Elasticsearch5/SearchAdapter

1 file changed

+3
-2
lines changed

app/code/Magento/Elasticsearch/Elasticsearch5/SearchAdapter/Adapter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public function __construct(
8989
AggregationBuilder $aggregationBuilder,
9090
\Magento\Elasticsearch\SearchAdapter\QueryContainerFactory $queryContainerFactory,
9191
LoggerInterface $logger = null
92-
)
93-
{
92+
) {
9493
$this->connectionManager = $connectionManager;
9594
$this->mapper = $mapper;
9695
$this->responseFactory = $responseFactory;
@@ -110,13 +109,15 @@ public function query(RequestInterface $request)
110109
$aggregationBuilder = $this->aggregationBuilder;
111110
$query = $this->mapper->buildQuery($request);
112111
$aggregationBuilder->setQuery($this->queryContainerFactory->create(['query' => $query]));
112+
113113
try {
114114
$rawResponse = $client->query($query);
115115
} catch (\Exception $e) {
116116
$this->logger->critical($e);
117117
// return empty search result in case an exception is thrown from Elasticsearch
118118
$rawResponse = self::$emptyRawResponse;
119119
}
120+
120121
$rawDocuments = isset($rawResponse['hits']['hits']) ? $rawResponse['hits']['hits'] : [];
121122
$queryResponse = $this->responseFactory->create(
122123
[

0 commit comments

Comments
 (0)