averma21 commented on a change in pull request #465:
URL: https://github.com/apache/jackrabbit-oak/pull/465#discussion_r787430905



##########
File path: 
oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LucenePropertyIndex.java
##########
@@ -1237,13 +1238,18 @@ private static Query createQuery(String propertyName, 
PropertyRestriction pr,
                 } else if (pr.isNotNullRestriction()) {
                     // not null. For date lower bound of zero can be used
                     return NumericRangeQuery.newLongRange(propertyName, 0L, 
Long.MAX_VALUE, true, true);
+                } else if (pr.isNot && pr.not != null) {
+                    // -[property]=[value]
+                    BooleanQuery bool = new BooleanQuery();
+                    // This will exclude entries with [property]=[value]
+                    bool.add(NumericRangeQuery.newLongRange(propertyName, 
pr.not.getValue(LONG), pr.not.getValue(LONG), true, true), MUST_NOT);

Review comment:
       Except for the default case, the boolean queries are not returned. I 
think return statement is missing and the tests only test for strings, so these 
cases didn't get detected.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to