Skip to content

Commit 0b2d939

Browse files
authored
TASK: Remove duplicate Elasticsearch check
The check in `extractSuggestions` is not needed, the method - as such does not rely on Elasticsearch - will not be called unless Elasticsearch is used (check in `indexAction`)
1 parent 57e128d commit 0b2d939

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Classes/Controller/SuggestController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,8 @@ protected function extractCompletions($response)
178178
*/
179179
protected function extractSuggestions($response)
180180
{
181-
if ($this->elasticSearchClient === null) {
182-
throw new \RuntimeException('The SuggestController needs an ElasticSearchClient, it seems you run without the flowpack/elasticsearch-contentrepositoryadaptor package, though.', 1487189823);
183-
}
184181
$suggestionOptions = isset($response['suggest']) ? $response['suggest'] : [];
182+
185183
if (count($suggestionOptions['suggestions'][0]['options']) > 0) {
186184
return $suggestionOptions['suggestions'][0]['options'];
187185
}

0 commit comments

Comments
 (0)