mirror of
https://github.com/apache/lucene.git
synced 2025-02-06 10:08:58 +00:00
LUCENE-6857: Validate StandardQueryParser with NOT operator with-in parantheses
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1710970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9f1248e841
commit
8b396d82ce
@ -227,6 +227,9 @@ Bug Fixes
|
||||
|
||||
Other
|
||||
|
||||
* LUCENE-6857: Validate StandardQueryParser with NOT operator
|
||||
with-in parantheses. (Jigar Shah via Dawid Weiss)
|
||||
|
||||
* LUCENE-6827: Use explicit capacity ArrayList instead of a LinkedList
|
||||
in MultiFieldQueryNodeProcessor. (Dawid Weiss).
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user