if (isAllNegative(restrictions) && restrictions.get(0).equals(restriction)) {
// By design Lucene does not process negative-only queries
query.add(new MatchAllDocsQuery(), Occur.SHOULD);
}
} else if (restriction.getOperator().equals(Operators.OPERATOR_BEGINS_WITH)) {
query.add(new PrefixQuery(new Term(restriction.getField().getKey(),
restriction.getValue())), Occur.MUST);
} else if (restriction.getOperator().equals(Operators.OPERATOR_NOT_BEGINS_WITH)) {
query.add(new PrefixQuery(new Term(restriction.getField().getKey(),
restriction.getValue())), Occur.MUST_NOT);
if (isAllNegative(restrictions) && restrictions.get(0).equals(restriction)) {
// By design Lucene does not process negative-only queries
query.add(new MatchAllDocsQuery(), Occur.SHOULD);
}