File tree 2 files changed +9
-1
lines changed
app/code/Magento/Elasticsearch
Test/Unit/SearchAdapter/Dynamic
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ public function getAggregation(
212
212
'histogram ' => [
213
213
'field ' => $ fieldName ,
214
214
'interval ' => (float )$ range ,
215
+ 'min_doc_count ' => 1 ,
215
216
],
216
217
],
217
218
];
Original file line number Diff line number Diff line change @@ -321,8 +321,15 @@ public function testGetAggregation()
321
321
$ this ->clientMock ->expects ($ this ->once ())
322
322
->method ('query ' )
323
323
->with ($ this ->callback (function ($ query ) {
324
+ $ histogramParams = $ query ['body ' ]['aggregations ' ]['prices ' ]['histogram ' ];
324
325
// Assert the interval is queried as a float. See MAGETWO-95471
325
- return $ query ['body ' ]['aggregations ' ]['prices ' ]['histogram ' ]['interval ' ] === 10.0 ;
326
+ if ($ histogramParams ['interval ' ] !== 10.0 ) {
327
+ return false ;
328
+ }
329
+ if (!isset ($ histogramParams ['min_doc_count ' ]) || $ histogramParams ['min_doc_count ' ] !== 1 ) {
330
+ return false ;
331
+ }
332
+ return true ;
326
333
}))
327
334
->willReturn ([
328
335
'aggregations ' => [
You can’t perform that action at this time.
0 commit comments