From e9d2f44d491946e1dd221b62a9e260321351cec6 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 29 Nov 2011 21:27:36 +0200 Subject: [PATCH] Query DSL: Bool filter does not take should clauses properly into account, closes #1511. --- .../common/lucene/search/XBooleanFilter.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java index 9d19e3a3968..03d8e728f28 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java @@ -89,10 +89,6 @@ public class XBooleanFilter extends Filter { if (notFilters != null) { for (int i = 0; i < notFilters.size(); i++) { - if (res == null) { - res = new FixedBitSet(reader.maxDoc()); - res.set(0, reader.maxDoc()); // NOTE: may set bits on deleted docs - } final DocIdSet disi = getDISI(notFilters, i, reader); if (disi != null) { DocSets.andNot(res, disi); @@ -106,12 +102,7 @@ public class XBooleanFilter extends Filter { if (disi == null) { return null; } - if (res == null) { - res = new FixedBitSet(reader.maxDoc()); - DocSets.or(res, disi); - } else { - DocSets.and(res, disi); - } + DocSets.and(res, disi); } }