diff --git a/Aggregation/TopHitsAggregation.php b/Aggregation/TopHitsAggregation.php index 0dc099e8a532d97c5ee74b4ea0102a927fc50fb4..17ad36e9f17b4b2f973b6348929b0e2ab52fe859 100644 --- a/Aggregation/TopHitsAggregation.php +++ b/Aggregation/TopHitsAggregation.php @@ -49,7 +49,9 @@ class TopHitsAggregation extends AbstractAggregation parent::__construct($name); $this->setFrom($from); $this->setSize($size); - $this->setSort($sort); + if (!empty($sort)) { + $this->setSort($sort); + } } /**