private function getSubAggregations($rawValue)
    {
        $subAggregations = [];

        foreach ($rawValue as $key => $value) {
            if (is_array($value)) {
                while (is_array($value) && isset($value[$key]) && is_array($value[$key])) {
                    $value = $value[$key];
                }

                if (isset($value['buckets'])) {
                    $subAggregations[$key] = $value;
                }
            }
        }

        return $this->create($subAggregations);
    }
private function getSubAggregations($rawValue)
    {
        $subAggregations = [];

        foreach ($rawValue as $key => $value) {
            if (is_array($value)) {
                while (is_array($value) && isset($value[$key]) && is_array($value[$key])) {
                    $value = $value[$key];
                }

                if (isset($value['buckets'])) {
                    $subAggregations[$key] = $value;
                }
            }
        }

        return $this->create($subAggregations);
    }
private function getSubAggregations ( $ rawValue ) { $ subAggregations = [ ] ; foreach ( $ rawValue as $ key => $ value ) { if ( is_array ( $ value ) ) { while ( is_array ( $ value ) && isset ( $ value [ $ key ] ) && is_array ( $ value [ $ key ] ) ) { $ value = $ value [ $ key ] ; } if ( isset ( $ value [ 'buckets' ] ) ) { $ subAggregations [ $ key ] = $ value ; } } } return $ this -> create ( $ subAggregations ) ; }
Parse a bucket and returns sub-aggregations.

@param array $rawValue Bucket data.

@return \Magento\Framework\Search\Response\Aggregation
Parse a bucket and returns sub - aggregations .