case 7:
case 6:
case 5:
hasMust = true;
if (rarely()) {
clauses[i] = new FilterClause(new EmptyFilter(), MUST);
topLevel.add(new BooleanClause(new MatchNoDocsQuery(), MUST));
} else {
clauses[i] = newFilterClause(field, value, MUST, random().nextBoolean());
topLevel.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), MUST));
}
break;
case 4:
case 3:
case 2:
case 1:
hasShould = true;
if (rarely()) {
clauses[i] = new FilterClause(new EmptyFilter(), SHOULD);
orQuery.add(new BooleanClause(new MatchNoDocsQuery(), SHOULD));
} else {
clauses[i] = newFilterClause(field, value, SHOULD, random().nextBoolean());
orQuery.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), SHOULD));
}
break;
case 0:
hasMustNot = true;
if (rarely()) {
clauses[i] = new FilterClause(new EmptyFilter(), MUST_NOT);
topLevel.add(new BooleanClause(new MatchNoDocsQuery(), MUST_NOT));
} else {
clauses[i] = newFilterClause(field, value, MUST_NOT, random().nextBoolean());
topLevel.add(new BooleanClause(new TermQuery(new Term(String.valueOf(field), String.valueOf(value))), MUST_NOT));
}