Elastica\ResultSet::hasAggregations PHP Method

hasAggregations() public method

Returns whether aggregations exist.
public hasAggregations ( ) : boolean
return boolean Aggregation existence
    public function hasAggregations()
    {
        $data = $this->_response->getData();
        return isset($data['aggregations']);
    }

Usage Example

 /**
  * @param ResultSet $result
  * @return bool
  */
 protected function collectAggregations(ResultSet $result)
 {
     if (!$result->hasAggregations()) {
         return false;
     }
     $this->aggregations = $result->getAggregations();
     return true;
 }