public function getFacetedData($field)
    {
        $this->_renderFilters();
        $result = [];
        $aggregations = $this->queryResponse->getAggregations();

        $bucket = $aggregations->getBucket($field);

        if ($bucket) {
            foreach ($bucket->getValues() as $value) {
                $metrics = $value->getMetrics();
                $result[$value->getValue()] = $metrics;
            }
        }

        return $result;
    }
public function getFacetedData($field)
    {
        $this->_renderFilters();
        $result = [];
        $aggregations = $this->queryResponse->getAggregations();

        $bucket = $aggregations->getBucket($field);

        if ($bucket) {
            foreach ($bucket->getValues() as $value) {
                $metrics = $value->getMetrics();
                $result[$value->getValue()] = $metrics;
            }
        }

        return $result;
    }
public function getFacetedData ( $ field ) { $ this -> _renderFilters ( ) ; $ result = [ ] ; $ aggregations = $ this -> queryResponse -> getAggregations ( ) ; $ bucket = $ aggregations -> getBucket ( $ field ) ; if ( $ bucket ) { foreach ( $ bucket -> getValues ( ) as $ value ) { $ metrics = $ value -> getMetrics ( ) ; $ result [ $ value -> getValue ( ) ] = $ metrics ; } } return $ result ; }
Return field faceted data from faceted search result.

@param string $field Facet field.

@return array
Return field faceted data from faceted search result .