Index: BooleanClause.java =================================================================== --- BooleanClause.java (revision 151205) +++ BooleanClause.java (working copy) @@ -71,6 +71,19 @@ query = q; required = r; prohibited = p; + if (required) { + if (prohibited) { + throw new IllegalArgumentException("BooleanClause cannot be required and prohibited"); + } else { + occur = Occur.MUST; + } + } else { + if (prohibited) { + occur = Occur.MUST_NOT; + } else { + occur = Occur.SHOULD; + } + } } /** Constructs a BooleanClause.