Skip to content

Commit

Permalink
return empty array if there are no aggregations
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Aug 7, 2024
1 parent 0bcaae0 commit 375d48a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Service/ElasticSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 375d48a

Please sign in to comment.