diff --git a/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java b/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java index cf7671f6bb1..2b85b2465ef 100644 --- a/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java +++ b/src/main/java/org/elasticsearch/index/query/BoolFilterParser.java @@ -117,9 +117,9 @@ public class BoolFilterParser implements FilterParser { } } - if ((boolFilter.getMustFilters() != null && boolFilter.getMustFilters().isEmpty()) - && (boolFilter.getNotFilters() != null && boolFilter.getNotFilters().isEmpty()) - && (boolFilter.getShouldFilters() != null && boolFilter.getShouldFilters().isEmpty())) { + if ((boolFilter.getMustFilters() == null || boolFilter.getMustFilters().isEmpty()) + && (boolFilter.getNotFilters() == null || boolFilter.getNotFilters().isEmpty()) + && (boolFilter.getShouldFilters() == null || boolFilter.getShouldFilters().isEmpty())) { return null; }