public function getAggregationCounts() {
        $counts = [];

        if (!isset($this->rawResponse['aggregations'])) {
            return $counts;
        }

        foreach ($this->rawResponse['aggregations'] as $name => $aggregation) {

            if (empty($aggregation['buckets'])) {
                continue; // Not all aggregations will count something...
            }

            foreach ($aggregation['buckets'] as $bucket) {
                $counts[$name][$bucket['key']] = $bucket['doc_count'];
            }
        }

        return $counts;
    }
public function getAggregationCounts() {
        $counts = [];

        if (!isset($this->rawResponse['aggregations'])) {
            return $counts;
        }

        foreach ($this->rawResponse['aggregations'] as $name => $aggregation) {

            if (empty($aggregation['buckets'])) {
                continue; // Not all aggregations will count something...
            }

            foreach ($aggregation['buckets'] as $bucket) {
                $counts[$name][$bucket['key']] = $bucket['doc_count'];
            }
        }

        return $counts;
    }
public function getAggregationCounts ( ) { $ counts = [ ] ; if ( ! isset ( $ this -> rawResponse [ 'aggregations' ] ) ) { return $ counts ; } foreach ( $ this -> rawResponse [ 'aggregations' ] as $ name => $ aggregation ) { if ( empty ( $ aggregation [ 'buckets' ] ) ) { continue ; // Not all aggregations will count something... } foreach ( $ aggregation [ 'buckets' ] as $ bucket ) { $ counts [ $ name ] [ $ bucket [ 'key' ] ] = $ bucket [ 'doc_count' ] ; } } return $ counts ; }
Return aggregation counts

@return array
Return aggregation counts