BoolQueryBuilder#hasClauses to take into account filterClauses too

This commit is contained in:
javanna 2015-07-06 11:02:09 +02:00 committed by Luca Cavanna
parent c5d3c46943
commit d085088793
1 changed files with 2 additions and 2 deletions

View File

@ -133,11 +133,11 @@ public class BoolQueryBuilder extends QueryBuilder implements BoostableQueryBuil
}
/**
* Returns <code>true</code> iff this query builder has at least one should, must or mustNot clause.
* Returns <code>true</code> iff this query builder has at least one should, must, must not or filter clause.
* Otherwise <code>false</code>.
*/
public boolean hasClauses() {
return !(mustClauses.isEmpty() && shouldClauses.isEmpty() && mustNotClauses.isEmpty());
return !(mustClauses.isEmpty() && shouldClauses.isEmpty() && mustNotClauses.isEmpty() && filterClauses.isEmpty());
}
/**