Skip to content

Commit 27cd601

Browse files
committed
Fill buckets for min and max aggs
1 parent e8525c1 commit 27cd601

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Response/ResultMapper.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,16 @@ private function mapAggregation(
198198
}
199199
}
200200

201+
if (
202+
! isset($aggregationArray['buckets'])
203+
&& ! isset($aggregationArray[$name]['buckets'])
204+
&& isset($aggregationArray['value'])
205+
) {
206+
$buckets[] = $this->mapBucket(0, [
207+
'doc_count' => $aggregationArray['value'],
208+
]);
209+
}
210+
201211
if (isset($aggregationArray['doc_count']) && $aggregationArray['doc_count'] > 0) {
202212
foreach ($aggregationArray as $aggregationName => $aggregation) {
203213
if ( ! \is_array($aggregation)) {

0 commit comments

Comments
 (0)