diff --git a/src/Aggregation/FilterAggregation.php b/src/Aggregation/FilterAggregation.php index 3655c31c6f9833519f01af19ba7c1a7a37d8167d..2e512baa6e30bc603fd492bc56c164763b643c1e 100644 --- a/src/Aggregation/FilterAggregation.php +++ b/src/Aggregation/FilterAggregation.php @@ -26,6 +26,21 @@ class FilterAggregation extends AbstractAggregation */ protected $filter; + /** + * Inner aggregations container init. + * + * @param string $name + * @param BuilderInterface $filter + */ + public function __construct($name, BuilderInterface $filter = null) + { + parent::__construct($name); + + if ($filter !== null) { + $this->setFilter($filter); + } + } + /** * Sets a filter. *