You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2015/10/28 16:31:16 UTC

svn commit: r1711037 - in /lucene/dev/branches/lucene_solr_4_10: ./ lucene/ lucene/CHANGES.txt lucene/queryparser/ lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java

Author: dweiss
Date: Wed Oct 28 15:31:16 2015
New Revision: 1711037

URL: http://svn.apache.org/viewvc?rev=1711037&view=rev
Log:
LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parentheses.

Modified:
    lucene/dev/branches/lucene_solr_4_10/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/CHANGES.txt
    lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/   (props changed)
    lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java

Modified: lucene/dev/branches/lucene_solr_4_10/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/lucene/CHANGES.txt?rev=1711037&r1=1711036&r2=1711037&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_4_10/lucene/CHANGES.txt Wed Oct 28 15:31:16 2015
@@ -15,6 +15,9 @@ Bug Fixes
 
 Other
 
+* LUCENE-6857: Validate StandardQueryParser with NOT operator 
+  with-in parentheses. (Jigar Shah via Dawid Weiss)
+
 * LUCENE-6248: Remove unused odd constants from StandardSyntaxParser.jj
   (Dawid Weiss)
 

Modified: lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java?rev=1711037&r1=1711036&r2=1711037&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java (original)
+++ lucene/dev/branches/lucene_solr_4_10/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java Wed Oct 28 15:31:16 2015
@@ -538,7 +538,18 @@ public class TestQPHelper extends Lucene
     assertQueryEquals("!term", null, "-term");
     assertQueryEquals("NOT term", null, "-term");
   }
-
+  
+  public void testNegationInParentheses() throws Exception {
+   assertQueryEquals("(-a)", null, "-a");
+   assertQueryEquals("(!a)", null, "-a");
+   assertQueryEquals("(NOT a)", null, "-a");
+   assertQueryEquals("a (!b)", null, "a (-b)");
+   assertQueryEquals("+a +(!b)", null, "+a +(-b)");
+   assertQueryEquals("a AND (!b)", null, "+a +(-b)");
+   assertQueryEquals("a (NOT b)", null, "a (-b)");
+   assertQueryEquals("a AND (NOT b)", null, "+a +(-b)");
+  }
+  
   public void testWildcard() throws Exception {
     assertQueryEquals("term*", null, "term*");
     assertQueryEquals("term*^2", null, "term*^2.0");