Skip to content

Commit

Permalink
Query DSL: Bool filter does not take should clauses properly into acc…
Browse files Browse the repository at this point in the history
…ount, closes elastic#1511.
  • Loading branch information
kimchy committed Nov 29, 2011
1 parent 7d8d747 commit 9cdfda8
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ public DocIdSet getDocIdSet(IndexReader reader) throws IOException {

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);
Expand All @@ -106,12 +102,7 @@ public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
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);
}
}

Expand Down

0 comments on commit 9cdfda8

Please sign in to comment.