diff --git a/src/Aggregation/HistogramAggregation.php b/src/Aggregation/HistogramAggregation.php index 3c5aaca426552dc0156a33fdcab1bb0c89349da3..1d4bbbe68d0218c2900c69ad491d66a574b5130d 100644 --- a/src/Aggregation/HistogramAggregation.php +++ b/src/Aggregation/HistogramAggregation.php @@ -122,7 +122,11 @@ class HistogramAggregation extends AbstractAggregation */ public function getOrder() { - return [$this->orderMode => $this->orderDirection]; + if ($this->orderMode && $this->orderDirection) { + return [$this->orderMode => $this->orderDirection]; + } else { + return null; + } } /**