Skip to content

Commit 937e088

Browse files
authored
Update helpers.js (#125)
Hide zero_count_doc facet only if it is not selected
1 parent 839275a commit 937e088

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/helpers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const FastBitSet = require('fastbitset');
33
const booleanParser = require('boolean-parser');
44

55
const clone = function(val) {
6+
67

78
try {
89
return JSON.parse(JSON.stringify(val));
@@ -356,7 +357,8 @@ const getBuckets = function(data, input, aggregations) {
356357

357358
let doc_count = v2[1].array().length;
358359

359-
if (hide_zero_doc_count && doc_count === 0) {
360+
//hide zero_doc_count facet only if it is not selected
361+
if (hide_zero_doc_count && doc_count === 0 && filters.indexOf(v2[0]) === -1) {
360362
return;
361363
}
362364

0 commit comments

Comments
 (0)