Skip to content

Commit ba1b77f

Browse files
committed
Query DSL: Bool filter does not take should clauses properly into account, closes elastic#1511.
1 parent e5816d9 commit ba1b77f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
8282
}
8383
}
8484

85+
// if no should clauses match, return null (act as min_should_match set to 1)
86+
if (res == null) {
87+
return null;
88+
}
89+
8590
if (notFilters != null) {
8691
for (int i = 0; i < notFilters.size(); i++) {
8792
if (res == null) {

0 commit comments

Comments
 (0)