Query DSL: Bool filter does not take should clauses properly into account, closes #1511.

This commit is contained in:
Shay Banon 2011-11-29 21:27:36 +02:00
parent de49a313c5
commit e9d2f44d49
1 changed files with 1 additions and 10 deletions

View File

@ -89,10 +89,6 @@ public class XBooleanFilter extends Filter {
if (notFilters != null) { if (notFilters != null) {
for (int i = 0; i < notFilters.size(); i++) { 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); final DocIdSet disi = getDISI(notFilters, i, reader);
if (disi != null) { if (disi != null) {
DocSets.andNot(res, disi); DocSets.andNot(res, disi);
@ -106,12 +102,7 @@ public class XBooleanFilter extends Filter {
if (disi == null) { if (disi == null) {
return null; return null;
} }
if (res == null) { DocSets.and(res, disi);
res = new FixedBitSet(reader.maxDoc());
DocSets.or(res, disi);
} else {
DocSets.and(res, disi);
}
} }
} }