lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r151252 - lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java
Date Thu, 03 Feb 2005 23:35:29 GMT
Author: dnaber
Date: Thu Feb  3 15:35:26 2005
New Revision: 151252

URL: http://svn.apache.org/viewcvs?view=rev&rev=151252
Log:
fix for #33395: The deprecated constructor of BooleanClause does not set new state (patch
provided by Paul Elschot, slightly modified)

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java?view=diff&r1=151251&r2=151252
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/BooleanClause.java Thu Feb  3 15:35:26
2005
@@ -71,6 +71,20 @@
     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.



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message