src/Search.php
public function addAggregation(AbstractAggregation $aggregation)
    {
        $this->getEndpoint(AggregationsEndpoint::NAME)->add($aggregation, $aggregation->getName());

        return $this;
    }
public function addAggregation(AbstractAggregation $aggregation)
    {
        $this->getEndpoint(AggregationsEndpoint::NAME)->add($aggregation, $aggregation->getName());

        return $this;
    }
public function addAggregation ( AbstractAggregation $ aggregation ) { $ this -> getEndpoint ( AggregationsEndpoint :: NAME ) -> add ( $ aggregation , $ aggregation -> getName ( ) ) ; return $ this ; }
Adds aggregation into search.

@param AbstractAggregation $aggregation

@return $this
Adds aggregation into search .