diff --git a/lib/Service/ElasticSearchService.php b/lib/Service/ElasticSearchService.php index da7bcdf6..73bf354c 100644 --- a/lib/Service/ElasticSearchService.php +++ b/lib/Service/ElasticSearchService.php @@ -191,6 +191,8 @@ public function searchObject(array $filters, array $config): array $return = ['results' => array_map(callback: [$this, 'formatResults'], array: $result['hits']['hits'])]; if(isset($result['aggregations']) === true) { $return['facets'] = array_map([$this, 'mapAggregationResults'], $result['aggregations']); + } else { + $return['facets'] = []; } return $return;