private function processSessionData(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\Aggregation\Value $value)
    {
        $data = ['session_id' => $value->getValue()];

        foreach ($value->getAggregations()->getBuckets() as $bucket) {
            $bucketName   = $bucket->getName();
            $bucketValues = [];

            foreach ($bucket->getValues() as $bucketValue) {
                $bucketValues[] = $bucketValue->getValue();
            }

            $data[$bucketName] = $bucketValues;
        }

        foreach ($value->getMetrics() as $metricName => $metricValue) {
            $data[$metricName] = $metricValue;
        }

        return $data;
    }
private function processSessionData(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\Aggregation\Value $value)
    {
        $data = ['session_id' => $value->getValue()];

        foreach ($value->getAggregations()->getBuckets() as $bucket) {
            $bucketName   = $bucket->getName();
            $bucketValues = [];

            foreach ($bucket->getValues() as $bucketValue) {
                $bucketValues[] = $bucketValue->getValue();
            }

            $data[$bucketName] = $bucketValues;
        }

        foreach ($value->getMetrics() as $metricName => $metricValue) {
            $data[$metricName] = $metricValue;
        }

        return $data;
    }
private function processSessionData ( \ Smile \ ElasticsuiteCore \ Search \ Adapter \ Elasticsuite \ Response \ Aggregation \ Value $ value ) { $ data = [ 'session_id' => $ value -> getValue ( ) ] ; foreach ( $ value -> getAggregations ( ) -> getBuckets ( ) as $ bucket ) { $ bucketName = $ bucket -> getName ( ) ; $ bucketValues = [ ] ; foreach ( $ bucket -> getValues ( ) as $ bucketValue ) { $ bucketValues [ ] = $ bucketValue -> getValue ( ) ; } $ data [ $ bucketName ] = $ bucketValues ; } foreach ( $ value -> getMetrics ( ) as $ metricName => $ metricValue ) { $ data [ $ metricName ] = $ metricValue ; } return $ data ; }
Prepare session data from search aggregation response.

@param \Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\Aggregation\Value $value Aggregation value.

@return array
Prepare session data from search aggregation response .