Skip to content

Commit 1f8067c

Browse files
committed
BUGFIX: make dependency with Elasticsearch optional (so that the system works with SimpleSearch)
1 parent 37c97f9 commit 1f8067c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Classes/Flowpack/SearchPlugin/Controller/SuggestController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class SuggestController extends ActionController
2121
{
2222
/**
23-
* @Flow\Inject
23+
* Dynamic dependency; to make the system work with SimpleSearch
2424
* @var \Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient
2525
*/
2626
protected $elasticSearchClient;
@@ -32,6 +32,13 @@ class SuggestController extends ActionController
3232
'json' => 'TYPO3\Flow\Mvc\View\JsonView'
3333
];
3434

35+
public function initializeObject()
36+
{
37+
if ($this->objectManager->isRegistered('Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient')) {
38+
$this->elasticSearchClient = $this->objectManager->get('Flowpack\ElasticSearch\ContentRepositoryAdaptor\ElasticSearchClient');
39+
}
40+
}
41+
3542
/**
3643
* @param string $term
3744
* @return void

0 commit comments

Comments
 (0)