Apache Solr open-source search software
LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parantheses
Dawid Weiss8b396d82ce6e
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 6aec45ff109..92fa303281c 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -227,6 +227,9 @@ Bug FixesOther+* LUCENE-6857: Validate StandardQueryParser with NOT operator+ with-in parantheses. (Jigar Shah via Dawid Weiss)+* LUCENE-6827: Use explicit capacity ArrayList instead of a LinkedListin MultiFieldQueryNodeProcessor. (Dawid Weiss).diff --git a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.javaindex ee29952882c..bb6c0a37223 100644--- a/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java+++ b/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestQPHelper.java@@ -538,7 +538,18 @@ public class TestQPHelper extends LuceneTestCase {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");