mirror of https://github.com/apache/lucene.git
fix for #33395: The deprecated constructor of BooleanClause does not set new state (patch provided by Paul Elschot, slightly modified)
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@151252 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ab72513214
commit
ecd4a7256d
|
@ -71,6 +71,20 @@ public class BooleanClause implements java.io.Serializable {
|
|||
query = q;
|
||||
required = r;
|
||||
prohibited = p;
|
||||
if (required) {
|
||||
if (prohibited) {
|
||||
// prohibited && required doesn't make sense, but we want the old behaviour:
|
||||
occur = Occur.MUST_NOT;
|
||||
} else {
|
||||
occur = Occur.MUST;
|
||||
}
|
||||
} else {
|
||||
if (prohibited) {
|
||||
occur = Occur.MUST_NOT;
|
||||
} else {
|
||||
occur = Occur.SHOULD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Constructs a BooleanClause.
|
||||
|
|
Loading…
Reference in New Issue