We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 521a61d commit f32b870Copy full SHA for f32b870
1 file changed
src/Response/ResultMapper.php
@@ -261,9 +261,11 @@ private function mapBucket(
261
array $bucketArray,
262
): \Spameri\ElasticQuery\Response\Result\Aggregation\Bucket
263
{
264
+ $bucketKey = $bucketArray['key'] ?? $bucketPosition;
265
+
266
return new \Spameri\ElasticQuery\Response\Result\Aggregation\Bucket(
- $bucketArray['key'] ?? (string) $bucketPosition,
- $bucketArray['doc_count'],
267
+ (string) $bucketKey,
268
+ (int) $bucketArray['doc_count'],
269
\is_int($bucketPosition) ? $bucketPosition : null,
270
$bucketArray['from'] ?? null,
271
$bucketArray['to'] ?? null,
0 commit comments