diff --git a/vendor/magento/module-elasticsearch/ElasticAdapter/SearchAdapter/Aggregation/Interval.php b/vendor/magento/module-elasticsearch/ElasticAdapter/SearchAdapter/Aggregation/Interval.php index 6f18a2d45d83..be86d5b25c35 100644 --- a/vendor/magento/module-elasticsearch/ElasticAdapter/SearchAdapter/Aggregation/Interval.php +++ b/vendor/magento/module-elasticsearch/ElasticAdapter/SearchAdapter/Aggregation/Interval.php @@ -99,6 +99,11 @@ public function load($limit, $offset = null, $lower = null, $upper = null) $to = ['lt' => $upper - self::DELTA]; } + if ($lower === null && $upper === null) { + $from = ['gte' => 0]; + $to = ['lt' => 0]; + } + $requestQuery = $this->prepareBaseRequestQuery($from, $to); $requestQuery = array_merge_recursive( $requestQuery, @@ -128,6 +133,11 @@ public function loadPrevious($data, $index, $lower = null) $to = ['lt' => $data - self::DELTA]; } + if ($lower === null && $data === 0.0) { + $from = ['gte' => 0]; + $to = ['lt' => 0]; + } + $requestQuery = $this->prepareBaseRequestQuery($from, $to); $requestQuery = array_merge_recursive( $requestQuery,