Index: lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java
===================================================================
--- lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java	(revision 1662995)
+++ lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java	(working copy)
@@ -264,7 +264,11 @@
       if (c.isProhibited()) {
         buffer.append("-");
       } else if (c.isRequired()) {
-        buffer.append("+");
+        if (c.isScoring()) {
+          buffer.append("+");
+        } else {
+          buffer.append("#");
+        }
       }
 
       Query subQuery = c.getQuery();
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/CharStream.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/CharStream.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/CharStream.java	(working copy)
@@ -112,4 +112,4 @@
   void Done();
 
 }
-/* JavaCC - OriginalChecksum=c847dd1920bf7901125a7244125682ad (do not edit this line) */
+/* JavaCC - OriginalChecksum=30b94cad7b10d0d81e3a59a1083939d0 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/ParseException.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/ParseException.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/ParseException.java	(working copy)
@@ -184,4 +184,4 @@
    }
 
 }
-/* JavaCC - OriginalChecksum=61602edcb3a15810cbc58f5593eba40d (do not edit this line) */
+/* JavaCC - OriginalChecksum=b187d97d5bb75c3fc63d642c1c26ac6e (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.java	(working copy)
@@ -92,12 +92,13 @@
   }
 
 // *   Query  ::= ( Clause )*
-// *   Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
+// *   Clause ::= ["+", "-", "#"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
   final public int Conjunction() throws ParseException {
   int ret = CONJ_NONE;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case AND:
     case OR:
+    case WHERE:
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case AND:
         jj_consume_token(AND);
@@ -107,6 +108,10 @@
         jj_consume_token(OR);
               ret = CONJ_OR;
         break;
+      case WHERE:
+        jj_consume_token(WHERE);
+                ret = CONJ_FILTER;
+        break;
       default:
         jj_la1[0] = jj_gen;
         jj_consume_token(-1);
@@ -127,6 +132,7 @@
     case NOT:
     case PLUS:
     case MINUS:
+    case POUND:
       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
       case PLUS:
         jj_consume_token(PLUS);
@@ -140,6 +146,10 @@
         jj_consume_token(NOT);
                ret = MOD_NOT;
         break;
+      case POUND:
+        jj_consume_token(POUND);
+                 ret = MOD_FILTER;
+        break;
       default:
         jj_la1[2] = jj_gen;
         jj_consume_token(-1);
@@ -164,7 +174,7 @@
   }
 
   final public Query Query(String field) throws ParseException {
-  List<BooleanClause> clauses = new ArrayList<>();
+  List<BooleanClause> clauses = new ArrayList<BooleanClause>();
   Query q, firstQuery=null;
   int conj, mods;
     mods = Modifiers();
@@ -178,8 +188,10 @@
       case AND:
       case OR:
       case NOT:
+      case WHERE:
       case PLUS:
       case MINUS:
+      case POUND:
       case BAREOPER:
       case LPAREN:
       case STAR:
@@ -467,6 +479,12 @@
     finally { jj_save(0, xla); }
   }
 
+  private boolean jj_3R_3() {
+    if (jj_scan_token(STAR)) return true;
+    if (jj_scan_token(COLON)) return true;
+    return false;
+  }
+
   private boolean jj_3R_2() {
     if (jj_scan_token(TERM)) return true;
     if (jj_scan_token(COLON)) return true;
@@ -483,12 +501,6 @@
     return false;
   }
 
-  private boolean jj_3R_3() {
-    if (jj_scan_token(STAR)) return true;
-    if (jj_scan_token(COLON)) return true;
-    return false;
-  }
-
   /** Generated Token Manager. */
   public QueryParserTokenManager token_source;
   /** Current token. */
@@ -507,10 +519,10 @@
       jj_la1_init_1();
    }
    private static void jj_la1_init_0() {
-      jj_la1_0 = new int[] {0x300,0x300,0x1c00,0x1c00,0xfda7f00,0x120000,0x40000,0xfda6000,0x9d22000,0x200000,0x200000,0x40000,0x6000000,0x80000000,0x10000000,0x80000000,0x60000000,0x40000,0x200000,0x40000,0xfda2000,};
+      jj_la1_0 = new int[] {0xb00,0xb00,0x7400,0x7400,0x3f69ff00,0x480000,0x100000,0x3f698000,0x27488000,0x800000,0x800000,0x100000,0x18000000,0x0,0x40000000,0x0,0x80000000,0x100000,0x800000,0x100000,0x3f688000,};
    }
    private static void jj_la1_init_1() {
-      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0,};
+      jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x0,0x6,0x1,0x0,0x0,0x0,0x0,};
    }
   final private JJCalls[] jj_2_rtns = new JJCalls[1];
   private boolean jj_rescan = false;
@@ -630,7 +642,7 @@
       return (jj_ntk = jj_nt.kind);
   }
 
-  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<>();
+  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
   private int[] jj_expentry;
   private int jj_kind = -1;
   private int[] jj_lasttokens = new int[100];
@@ -664,7 +676,7 @@
   /** Generate ParseException. */
   public ParseException generateParseException() {
     jj_expentries.clear();
-    boolean[] la1tokens = new boolean[33];
+    boolean[] la1tokens = new boolean[35];
     if (jj_kind >= 0) {
       la1tokens[jj_kind] = true;
       jj_kind = -1;
@@ -681,7 +693,7 @@
         }
       }
     }
-    for (int i = 0; i < 33; i++) {
+    for (int i = 0; i < 35; i++) {
       if (la1tokens[i]) {
         jj_expentry = new int[1];
         jj_expentry[0] = i;
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj	(working copy)
@@ -126,10 +126,10 @@
   <#_NUM_CHAR:   ["0"-"9"] >
 // every character that follows a backslash is considered as an escaped character
 | <#_ESCAPED_CHAR: "\\" ~[] >
-| <#_TERM_START_CHAR: ( ~[ " ", "\t", "\n", "\r", "\u3000", "+", "-", "!", "(", ")", ":", "^",
+| <#_TERM_START_CHAR: ( ~[ " ", "\t", "\n", "\r", "\u3000", "+", "-", "#", "!", "(", ")", ":", "^",
                            "[", "]", "\"", "{", "}", "~", "*", "?", "\\", "/" ]
                        | <_ESCAPED_CHAR> ) >
-| <#_TERM_CHAR: ( <_TERM_START_CHAR> | <_ESCAPED_CHAR> | "-" | "+" ) >
+| <#_TERM_CHAR: ( <_TERM_START_CHAR> | <_ESCAPED_CHAR> | "-" | "+" | "#" ) >
 | <#_WHITESPACE: ( " " | "\t" | "\n" | "\r" | "\u3000") >
 | <#_QUOTED_CHAR: ( ~[ "\"", "\\" ] | <_ESCAPED_CHAR> ) >
 }
@@ -142,9 +142,11 @@
   <AND:       ("AND" | "&&") >
 | <OR:        ("OR" | "||") >
 | <NOT:       ("NOT" | "!") >
+| <WHERE:     "WHERE" >
 | <PLUS:      "+" >
 | <MINUS:     "-" >
-| <BAREOPER:    ("+"|"-"|"!") <_WHITESPACE> >
+| <POUND:     "#" >
+| <BAREOPER:    ("+"|"-"|"!"|"#") <_WHITESPACE> >
 | <LPAREN:    "(" >
 | <RPAREN:    ")" >
 | <COLON:     ":" >
@@ -173,7 +175,7 @@
 }
 
 // *   Query  ::= ( Clause )*
-// *   Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
+// *   Clause ::= ["+", "-", "#"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
 
 int Conjunction() : {
   int ret = CONJ_NONE;
@@ -182,6 +184,7 @@
   [
     <AND> { ret = CONJ_AND; }
     | <OR>  { ret = CONJ_OR; }
+    | <WHERE> { ret = CONJ_FILTER; }
   ]
   { return ret; }
 }
@@ -194,6 +197,7 @@
      <PLUS> { ret = MOD_REQ; }
      | <MINUS> { ret = MOD_NOT; }
      | <NOT> { ret = MOD_NOT; }
+     | <POUND> { ret = MOD_FILTER; }
   ]
   { return ret; }
 }
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java	(working copy)
@@ -48,10 +48,12 @@
   static final int CONJ_NONE   = 0;
   static final int CONJ_AND    = 1;
   static final int CONJ_OR     = 2;
+  static final int CONJ_FILTER = 3;
 
   static final int MOD_NONE    = 0;
   static final int MOD_NOT     = 10;
   static final int MOD_REQ     = 11;
+  static final int MOD_FILTER  = 12;
 
   // make it possible to call setDefaultOperator() without accessing
   // the nested class:
@@ -415,14 +417,15 @@
   }
 
   protected void addClause(List<BooleanClause> clauses, int conj, int mods, Query q) {
-    boolean required, prohibited;
+    boolean required, prohibited, scoring;
 
-    // If this term is introduced by AND, make the preceding term required,
+    // If this term is introduced by AND/FILTER, make the preceding term required,
     // unless it's already prohibited
     if (clauses.size() > 0 && conj == CONJ_AND) {
       BooleanClause c = clauses.get(clauses.size()-1);
-      if (!c.isProhibited())
+      if (!c.isProhibited()) {
         c.setOccur(BooleanClause.Occur.MUST);
+      }
     }
 
     if (clauses.size() > 0 && operator == AND_OPERATOR && conj == CONJ_OR) {
@@ -441,12 +444,15 @@
       return;
 
     if (operator == OR_OPERATOR) {
-      // We set REQUIRED if we're introduced by AND or +; PROHIBITED if
+      // We set REQUIRED if we're introduced by AND/+/WHERE/#; PROHIBITED if
       // introduced by NOT or -; make sure not to set both.
       prohibited = (mods == MOD_NOT);
-      required = (mods == MOD_REQ);
-      if (conj == CONJ_AND && !prohibited) {
+      required = (mods == MOD_REQ || mods == MOD_FILTER);
+      if ((conj == CONJ_AND || conj == CONJ_FILTER) && !prohibited) {
         required = true;
+        scoring = conj == CONJ_AND;
+      } else {
+        scoring = !prohibited && mods != MOD_FILTER;
       }
     } else {
       // We set PROHIBITED if we're introduced by NOT or -; We set REQUIRED
@@ -453,15 +459,21 @@
       // if not PROHIBITED and not introduced by OR
       prohibited = (mods == MOD_NOT);
       required   = (!prohibited && conj != CONJ_OR);
+      scoring    = (!prohibited && conj != CONJ_FILTER);
     }
-    if (required && !prohibited)
-      clauses.add(newBooleanClause(q, BooleanClause.Occur.MUST));
-    else if (!required && !prohibited)
+    if (required && !prohibited) {
+      if (scoring) {
+        clauses.add(newBooleanClause(q, BooleanClause.Occur.MUST));
+      } else {
+        clauses.add(newBooleanClause(q, BooleanClause.Occur.FILTER));
+      }
+    } else if (!required && !prohibited) {
       clauses.add(newBooleanClause(q, BooleanClause.Occur.SHOULD));
-    else if (!required && prohibited)
+    } else if (!required && prohibited) {
       clauses.add(newBooleanClause(q, BooleanClause.Occur.MUST_NOT));
-    else
+    } else {
       throw new RuntimeException("Clause cannot be both required and prohibited");
+    }
   }
 
   /**
@@ -993,7 +1005,7 @@
       // These characters are part of the query syntax and must be escaped
       if (c == '\\' || c == '+' || c == '-' || c == '!' || c == '(' || c == ')' || c == ':'
         || c == '^' || c == '[' || c == ']' || c == '\"' || c == '{' || c == '}' || c == '~'
-        || c == '*' || c == '?' || c == '|' || c == '&' || c == '/') {
+        || c == '*' || c == '?' || c == '|' || c == '&' || c == '/' || c == '#') {
         sb.append('\\');
       }
       sb.append(c);
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserConstants.java	(working copy)
@@ -29,49 +29,53 @@
   /** RegularExpression Id. */
   int NOT = 10;
   /** RegularExpression Id. */
-  int PLUS = 11;
+  int WHERE = 11;
   /** RegularExpression Id. */
-  int MINUS = 12;
+  int PLUS = 12;
   /** RegularExpression Id. */
-  int BAREOPER = 13;
+  int MINUS = 13;
   /** RegularExpression Id. */
-  int LPAREN = 14;
+  int POUND = 14;
   /** RegularExpression Id. */
-  int RPAREN = 15;
+  int BAREOPER = 15;
   /** RegularExpression Id. */
-  int COLON = 16;
+  int LPAREN = 16;
   /** RegularExpression Id. */
-  int STAR = 17;
+  int RPAREN = 17;
   /** RegularExpression Id. */
-  int CARAT = 18;
+  int COLON = 18;
   /** RegularExpression Id. */
-  int QUOTED = 19;
+  int STAR = 19;
   /** RegularExpression Id. */
-  int TERM = 20;
+  int CARAT = 20;
   /** RegularExpression Id. */
-  int FUZZY_SLOP = 21;
+  int QUOTED = 21;
   /** RegularExpression Id. */
-  int PREFIXTERM = 22;
+  int TERM = 22;
   /** RegularExpression Id. */
-  int WILDTERM = 23;
+  int FUZZY_SLOP = 23;
   /** RegularExpression Id. */
-  int REGEXPTERM = 24;
+  int PREFIXTERM = 24;
   /** RegularExpression Id. */
-  int RANGEIN_START = 25;
+  int WILDTERM = 25;
   /** RegularExpression Id. */
-  int RANGEEX_START = 26;
+  int REGEXPTERM = 26;
   /** RegularExpression Id. */
-  int NUMBER = 27;
+  int RANGEIN_START = 27;
   /** RegularExpression Id. */
-  int RANGE_TO = 28;
+  int RANGEEX_START = 28;
   /** RegularExpression Id. */
-  int RANGEIN_END = 29;
+  int NUMBER = 29;
   /** RegularExpression Id. */
-  int RANGEEX_END = 30;
+  int RANGE_TO = 30;
   /** RegularExpression Id. */
-  int RANGE_QUOTED = 31;
+  int RANGEIN_END = 31;
   /** RegularExpression Id. */
-  int RANGE_GOOP = 32;
+  int RANGEEX_END = 32;
+  /** RegularExpression Id. */
+  int RANGE_QUOTED = 33;
+  /** RegularExpression Id. */
+  int RANGE_GOOP = 34;
 
   /** Lexical state. */
   int Boost = 0;
@@ -93,8 +97,10 @@
     "<AND>",
     "<OR>",
     "<NOT>",
+    "\"WHERE\"",
     "\"+\"",
     "\"-\"",
+    "\"#\"",
     "<BAREOPER>",
     "\"(\"",
     "\")\"",
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.java	(working copy)
@@ -10,7 +10,6 @@
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermRangeQuery;
 import org.apache.lucene.search.TermQuery;
-import org.apache.lucene.util.Version;
 
 /** Token Manager. */
 public class QueryParserTokenManager implements QueryParserConstants
@@ -24,6 +23,41 @@
 {
    switch (pos)
    {
+      case 0:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 22;
+            return 49;
+         }
+         if ((active0 & 0x80000L) != 0L)
+            return 50;
+         if ((active0 & 0x7000L) != 0L)
+            return 15;
+         return -1;
+      case 1:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 22;
+            jjmatchedPos = 1;
+            return 49;
+         }
+         return -1;
+      case 2:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 22;
+            jjmatchedPos = 2;
+            return 49;
+         }
+         return -1;
+      case 3:
+         if ((active0 & 0x800L) != 0L)
+         {
+            jjmatchedKind = 22;
+            jjmatchedPos = 3;
+            return 49;
+         }
+         return -1;
       default :
          return -1;
    }
@@ -42,28 +76,104 @@
 {
    switch(curChar)
    {
+      case 35:
+         return jjStartNfaWithStates_2(0, 14, 15);
       case 40:
-         return jjStopAtPos(0, 14);
+         return jjStopAtPos(0, 16);
       case 41:
-         return jjStopAtPos(0, 15);
+         return jjStopAtPos(0, 17);
       case 42:
-         return jjStartNfaWithStates_2(0, 17, 49);
+         return jjStartNfaWithStates_2(0, 19, 50);
       case 43:
-         return jjStartNfaWithStates_2(0, 11, 15);
+         return jjStartNfaWithStates_2(0, 12, 15);
       case 45:
-         return jjStartNfaWithStates_2(0, 12, 15);
+         return jjStartNfaWithStates_2(0, 13, 15);
       case 58:
-         return jjStopAtPos(0, 16);
+         return jjStopAtPos(0, 18);
+      case 87:
+         return jjMoveStringLiteralDfa1_2(0x800L);
       case 91:
-         return jjStopAtPos(0, 25);
+         return jjStopAtPos(0, 27);
       case 94:
-         return jjStopAtPos(0, 18);
+         return jjStopAtPos(0, 20);
       case 123:
-         return jjStopAtPos(0, 26);
+         return jjStopAtPos(0, 28);
       default :
          return jjMoveNfa_2(0, 0);
    }
 }
+private int jjMoveStringLiteralDfa1_2(long active0)
+{
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_2(0, active0);
+      return 1;
+   }
+   switch(curChar)
+   {
+      case 72:
+         return jjMoveStringLiteralDfa2_2(active0, 0x800L);
+      default :
+         break;
+   }
+   return jjStartNfa_2(0, active0);
+}
+private int jjMoveStringLiteralDfa2_2(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_2(0, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_2(1, active0);
+      return 2;
+   }
+   switch(curChar)
+   {
+      case 69:
+         return jjMoveStringLiteralDfa3_2(active0, 0x800L);
+      default :
+         break;
+   }
+   return jjStartNfa_2(1, active0);
+}
+private int jjMoveStringLiteralDfa3_2(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_2(1, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_2(2, active0);
+      return 3;
+   }
+   switch(curChar)
+   {
+      case 82:
+         return jjMoveStringLiteralDfa4_2(active0, 0x800L);
+      default :
+         break;
+   }
+   return jjStartNfa_2(2, active0);
+}
+private int jjMoveStringLiteralDfa4_2(long old0, long active0)
+{
+   if (((active0 &= old0)) == 0L)
+      return jjStartNfa_2(2, old0);
+   try { curChar = input_stream.readChar(); }
+   catch(java.io.IOException e) {
+      jjStopStringLiteralDfa_2(3, active0);
+      return 4;
+   }
+   switch(curChar)
+   {
+      case 69:
+         if ((active0 & 0x800L) != 0L)
+            return jjStartNfaWithStates_2(4, 11, 49);
+         break;
+      default :
+         break;
+   }
+   return jjStartNfa_2(3, active0);
+}
 private int jjStartNfaWithStates_2(int pos, int kind, int state)
 {
    jjmatchedKind = kind;
@@ -102,42 +212,63 @@
          {
             switch(jjstateSet[--i])
             {
-               case 49:
+               case 50:
                case 33:
                   if ((0xfbff7cf8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
+               case 49:
+                  if ((0xfbff7cf8ffffd9ffL & l) != 0L)
+                  {
+                     if (kind > 25)
+                        kind = 25;
+                     jjCheckNAddTwoStates(33, 34);
+                  }
+                  if ((0x7bff78f8ffffd9ffL & l) != 0L)
+                     jjCheckNAddStates(0, 2);
+                  else if (curChar == 42)
+                  {
+                     if (kind > 24)
+                        kind = 24;
+                  }
+                  if ((0x7bff78f8ffffd9ffL & l) != 0L)
+                  {
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddTwoStates(42, 43);
+                  }
+                  break;
                case 0:
-                  if ((0xfbff54f8ffffd9ffL & l) != 0L)
+                  if ((0xfbff54f0ffffd9ffL & l) != 0L)
                   {
-                     if (kind > 23)
-                        kind = 23;
+                     if (kind > 25)
+                        kind = 25;
                      jjCheckNAddTwoStates(33, 34);
                   }
+                  else if ((0x280a00000000L & l) != 0L)
+                     jjstateSet[jjnewStateCnt++] = 15;
                   else if ((0x100002600L & l) != 0L)
                   {
                      if (kind > 7)
                         kind = 7;
                   }
-                  else if ((0x280200000000L & l) != 0L)
-                     jjstateSet[jjnewStateCnt++] = 15;
                   else if (curChar == 47)
-                     jjCheckNAddStates(0, 2);
+                     jjCheckNAddStates(3, 5);
                   else if (curChar == 34)
-                     jjCheckNAddStates(3, 5);
-                  if ((0x7bff50f8ffffd9ffL & l) != 0L)
+                     jjCheckNAddStates(6, 8);
+                  if ((0x7bff50f0ffffd9ffL & l) != 0L)
                   {
-                     if (kind > 20)
-                        kind = 20;
-                     jjCheckNAddStates(6, 10);
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddStates(9, 13);
                   }
                   else if (curChar == 42)
                   {
-                     if (kind > 22)
-                        kind = 22;
+                     if (kind > 24)
+                        kind = 24;
                   }
                   else if (curChar == 33)
                   {
@@ -160,34 +291,34 @@
                      kind = 10;
                   break;
                case 14:
-                  if ((0x280200000000L & l) != 0L)
+                  if ((0x280a00000000L & l) != 0L)
                      jjstateSet[jjnewStateCnt++] = 15;
                   break;
                case 15:
-                  if ((0x100002600L & l) != 0L && kind > 13)
-                     kind = 13;
+                  if ((0x100002600L & l) != 0L && kind > 15)
+                     kind = 15;
                   break;
                case 16:
                   if (curChar == 34)
-                     jjCheckNAddStates(3, 5);
+                     jjCheckNAddStates(6, 8);
                   break;
                case 17:
                   if ((0xfffffffbffffffffL & l) != 0L)
-                     jjCheckNAddStates(3, 5);
+                     jjCheckNAddStates(6, 8);
                   break;
                case 19:
-                  jjCheckNAddStates(3, 5);
+                  jjCheckNAddStates(6, 8);
                   break;
                case 20:
-                  if (curChar == 34 && kind > 19)
-                     kind = 19;
+                  if (curChar == 34 && kind > 21)
+                     kind = 21;
                   break;
                case 22:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
-                  jjCheckNAddStates(11, 14);
+                  if (kind > 23)
+                     kind = 23;
+                  jjCheckNAddStates(14, 17);
                   break;
                case 23:
                   if (curChar == 46)
@@ -196,88 +327,88 @@
                case 24:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
-                  jjCheckNAddStates(15, 17);
+                  if (kind > 23)
+                     kind = 23;
+                  jjCheckNAddStates(18, 20);
                   break;
                case 25:
                   if ((0x7bff78f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 27:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if ((0x7bff78f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 30:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 31:
-                  if (curChar == 42 && kind > 22)
-                     kind = 22;
+                  if (curChar == 42 && kind > 24)
+                     kind = 24;
                   break;
                case 32:
-                  if ((0xfbff54f8ffffd9ffL & l) == 0L)
+                  if ((0xfbff54f0ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 35:
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 36:
                case 38:
                   if (curChar == 47)
-                     jjCheckNAddStates(0, 2);
+                     jjCheckNAddStates(3, 5);
                   break;
                case 37:
                   if ((0xffff7fffffffffffL & l) != 0L)
-                     jjCheckNAddStates(0, 2);
+                     jjCheckNAddStates(3, 5);
                   break;
                case 40:
-                  if (curChar == 47 && kind > 24)
-                     kind = 24;
+                  if (curChar == 47 && kind > 26)
+                     kind = 26;
                   break;
                case 41:
-                  if ((0x7bff50f8ffffd9ffL & l) == 0L)
+                  if ((0x7bff50f0ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 20)
-                     kind = 20;
-                  jjCheckNAddStates(6, 10);
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddStates(9, 13);
                   break;
                case 42:
                   if ((0x7bff78f8ffffd9ffL & l) == 0L)
                      break;
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 44:
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 45:
                   if ((0x7bff78f8ffffd9ffL & l) != 0L)
-                     jjCheckNAddStates(18, 20);
+                     jjCheckNAddStates(0, 2);
                   break;
                case 47:
-                  jjCheckNAddStates(18, 20);
+                  jjCheckNAddStates(0, 2);
                   break;
                default : break;
             }
@@ -290,35 +421,57 @@
          {
             switch(jjstateSet[--i])
             {
+               case 50:
+                  if ((0x97ffffff87ffffffL & l) != 0L)
+                  {
+                     if (kind > 25)
+                        kind = 25;
+                     jjCheckNAddTwoStates(33, 34);
+                  }
+                  else if (curChar == 92)
+                     jjCheckNAddTwoStates(35, 35);
+                  break;
                case 49:
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 23)
-                        kind = 23;
+                     if (kind > 25)
+                        kind = 25;
                      jjCheckNAddTwoStates(33, 34);
                   }
                   else if (curChar == 92)
+                     jjCheckNAddTwoStates(44, 44);
+                  if ((0x97ffffff87ffffffL & l) != 0L)
+                     jjCheckNAddStates(0, 2);
+                  else if (curChar == 92)
+                     jjCheckNAddTwoStates(47, 47);
+                  if ((0x97ffffff87ffffffL & l) != 0L)
+                  {
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddTwoStates(42, 43);
+                  }
+                  else if (curChar == 92)
                      jjCheckNAddTwoStates(35, 35);
                   break;
                case 0:
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 20)
-                        kind = 20;
-                     jjCheckNAddStates(6, 10);
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddStates(9, 13);
                   }
                   else if (curChar == 92)
                      jjCheckNAddStates(21, 23);
                   else if (curChar == 126)
                   {
-                     if (kind > 21)
-                        kind = 21;
+                     if (kind > 23)
+                        kind = 23;
                      jjCheckNAddStates(24, 26);
                   }
                   if ((0x97ffffff87ffffffL & l) != 0L)
                   {
-                     if (kind > 23)
-                        kind = 23;
+                     if (kind > 25)
+                        kind = 25;
                      jjCheckNAddTwoStates(33, 34);
                   }
                   if (curChar == 78)
@@ -372,7 +525,7 @@
                   break;
                case 17:
                   if ((0xffffffffefffffffL & l) != 0L)
-                     jjCheckNAddStates(3, 5);
+                     jjCheckNAddStates(6, 8);
                   break;
                case 18:
                   if (curChar == 92)
@@ -379,20 +532,20 @@
                      jjstateSet[jjnewStateCnt++] = 19;
                   break;
                case 19:
-                  jjCheckNAddStates(3, 5);
+                  jjCheckNAddStates(6, 8);
                   break;
                case 21:
                   if (curChar != 126)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddStates(24, 26);
                   break;
                case 25:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 26:
@@ -400,15 +553,15 @@
                      jjAddStates(27, 28);
                   break;
                case 27:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 29:
@@ -416,22 +569,22 @@
                      jjAddStates(29, 30);
                   break;
                case 30:
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 32:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 33:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 34:
@@ -439,12 +592,12 @@
                      jjCheckNAddTwoStates(35, 35);
                   break;
                case 35:
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 37:
-                  jjAddStates(0, 2);
+                  jjAddStates(3, 5);
                   break;
                case 39:
                   if (curChar == 92)
@@ -453,15 +606,15 @@
                case 41:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 20)
-                     kind = 20;
-                  jjCheckNAddStates(6, 10);
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddStates(9, 13);
                   break;
                case 42:
                   if ((0x97ffffff87ffffffL & l) == 0L)
                      break;
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 43:
@@ -469,13 +622,13 @@
                      jjCheckNAddTwoStates(44, 44);
                   break;
                case 44:
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 45:
                   if ((0x97ffffff87ffffffL & l) != 0L)
-                     jjCheckNAddStates(18, 20);
+                     jjCheckNAddStates(0, 2);
                   break;
                case 46:
                   if (curChar == 92)
@@ -482,7 +635,7 @@
                      jjCheckNAddTwoStates(47, 47);
                   break;
                case 47:
-                  jjCheckNAddStates(18, 20);
+                  jjCheckNAddStates(0, 2);
                   break;
                case 48:
                   if (curChar == 92)
@@ -503,14 +656,30 @@
          {
             switch(jjstateSet[--i])
             {
-               case 49:
+               case 50:
                case 33:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
+               case 49:
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                  {
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddTwoStates(42, 43);
+                  }
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                     jjCheckNAddStates(0, 2);
+                  if (jjCanMove_2(hiByte, i1, i2, l1, l2))
+                  {
+                     if (kind > 25)
+                        kind = 25;
+                     jjCheckNAddTwoStates(33, 34);
+                  }
+                  break;
                case 0:
                   if (jjCanMove_0(hiByte, i1, i2, l1, l2))
                   {
@@ -519,100 +688,100 @@
                   }
                   if (jjCanMove_2(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 23)
-                        kind = 23;
+                     if (kind > 25)
+                        kind = 25;
                      jjCheckNAddTwoStates(33, 34);
                   }
                   if (jjCanMove_2(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 20)
-                        kind = 20;
-                     jjCheckNAddStates(6, 10);
+                     if (kind > 22)
+                        kind = 22;
+                     jjCheckNAddStates(9, 13);
                   }
                   break;
                case 15:
-                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 13)
-                     kind = 13;
+                  if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 15)
+                     kind = 15;
                   break;
                case 17:
                case 19:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     jjCheckNAddStates(3, 5);
+                     jjCheckNAddStates(6, 8);
                   break;
                case 25:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 27:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(25, 26);
                   break;
                case 28:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 30:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 21)
-                     kind = 21;
+                  if (kind > 23)
+                     kind = 23;
                   jjCheckNAddTwoStates(28, 29);
                   break;
                case 32:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 35:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 23)
-                     kind = 23;
+                  if (kind > 25)
+                     kind = 25;
                   jjCheckNAddTwoStates(33, 34);
                   break;
                case 37:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     jjAddStates(0, 2);
+                     jjAddStates(3, 5);
                   break;
                case 41:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 20)
-                     kind = 20;
-                  jjCheckNAddStates(6, 10);
+                  if (kind > 22)
+                     kind = 22;
+                  jjCheckNAddStates(9, 13);
                   break;
                case 42:
                   if (!jjCanMove_2(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 44:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 20)
-                     kind = 20;
+                  if (kind > 22)
+                     kind = 22;
                   jjCheckNAddTwoStates(42, 43);
                   break;
                case 45:
                   if (jjCanMove_2(hiByte, i1, i2, l1, l2))
-                     jjCheckNAddStates(18, 20);
+                     jjCheckNAddStates(0, 2);
                   break;
                case 47:
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
-                     jjCheckNAddStates(18, 20);
+                     jjCheckNAddStates(0, 2);
                   break;
                default : break;
             }
@@ -656,8 +825,8 @@
                case 0:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 27)
-                     kind = 27;
+                  if (kind > 29)
+                     kind = 29;
                   jjAddStates(31, 32);
                   break;
                case 1:
@@ -667,8 +836,8 @@
                case 2:
                   if ((0x3ff000000000000L & l) == 0L)
                      break;
-                  if (kind > 27)
-                     kind = 27;
+                  if (kind > 29)
+                     kind = 29;
                   jjCheckNAdd(2);
                   break;
                default : break;
@@ -719,9 +888,9 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x10000000L) != 0L)
+         if ((active0 & 0x40000000L) != 0L)
          {
-            jjmatchedKind = 32;
+            jjmatchedKind = 34;
             return 6;
          }
          return -1;
@@ -738,11 +907,11 @@
    switch(curChar)
    {
       case 84:
-         return jjMoveStringLiteralDfa1_1(0x10000000L);
+         return jjMoveStringLiteralDfa1_1(0x40000000L);
       case 93:
-         return jjStopAtPos(0, 29);
+         return jjStopAtPos(0, 31);
       case 125:
-         return jjStopAtPos(0, 30);
+         return jjStopAtPos(0, 32);
       default :
          return jjMoveNfa_1(0, 0);
    }
@@ -757,8 +926,8 @@
    switch(curChar)
    {
       case 79:
-         if ((active0 & 0x10000000L) != 0L)
-            return jjStartNfaWithStates_1(1, 28, 6);
+         if ((active0 & 0x40000000L) != 0L)
+            return jjStartNfaWithStates_1(1, 30, 6);
          break;
       default :
          break;
@@ -794,8 +963,8 @@
                case 0:
                   if ((0xfffffffeffffffffL & l) != 0L)
                   {
-                     if (kind > 32)
-                        kind = 32;
+                     if (kind > 34)
+                        kind = 34;
                      jjCheckNAdd(6);
                   }
                   if ((0x100002600L & l) != 0L)
@@ -819,14 +988,14 @@
                      jjCheckNAddStates(33, 35);
                   break;
                case 5:
-                  if (curChar == 34 && kind > 31)
-                     kind = 31;
+                  if (curChar == 34 && kind > 33)
+                     kind = 33;
                   break;
                case 6:
                   if ((0xfffffffeffffffffL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 34)
+                     kind = 34;
                   jjCheckNAdd(6);
                   break;
                default : break;
@@ -844,8 +1013,8 @@
                case 6:
                   if ((0xdfffffffdfffffffL & l) == 0L)
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 34)
+                     kind = 34;
                   jjCheckNAdd(6);
                   break;
                case 2:
@@ -878,8 +1047,8 @@
                   }
                   if (jjCanMove_1(hiByte, i1, i2, l1, l2))
                   {
-                     if (kind > 32)
-                        kind = 32;
+                     if (kind > 34)
+                        kind = 34;
                      jjCheckNAdd(6);
                   }
                   break;
@@ -890,8 +1059,8 @@
                case 6:
                   if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
                      break;
-                  if (kind > 32)
-                     kind = 32;
+                  if (kind > 34)
+                     kind = 34;
                   jjCheckNAdd(6);
                   break;
                default : break;
@@ -912,8 +1081,8 @@
    }
 }
 static final int[] jjnextStates = {
-   37, 39, 40, 17, 18, 20, 42, 45, 31, 46, 43, 22, 23, 25, 26, 24, 
-   25, 26, 45, 31, 46, 44, 47, 35, 22, 28, 29, 27, 27, 30, 30, 0, 
+   45, 31, 46, 37, 39, 40, 17, 18, 20, 42, 45, 31, 46, 43, 22, 23, 
+   25, 26, 24, 25, 26, 44, 47, 35, 22, 28, 29, 27, 27, 30, 30, 0, 
    1, 2, 4, 5, 
 };
 private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
@@ -955,9 +1124,9 @@
 
 /** Token literal values. */
 public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, null, null, null, null, "\53", "\55", 
-null, "\50", "\51", "\72", "\52", "\136", null, null, null, null, null, null, 
-"\133", "\173", null, "\124\117", "\135", "\175", null, null, };
+"", null, null, null, null, null, null, null, null, null, null, 
+"\127\110\105\122\105", "\53", "\55", "\43", null, "\50", "\51", "\72", "\52", "\136", null, null, 
+null, null, null, null, "\133", "\173", null, "\124\117", "\135", "\175", null, null, };
 
 /** Lexer state names. */
 public static final String[] lexStateNames = {
@@ -968,11 +1137,11 @@
 
 /** Lex State array. */
 public static final int[] jjnewLexState = {
-   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, 
-   1, 1, 2, -1, 2, 2, -1, -1, 
+   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, 
+   -1, -1, 1, 1, 2, -1, 2, 2, -1, -1, 
 };
 static final long[] jjtoToken = {
-   0x1ffffff01L, 
+   0x7ffffff01L, 
 };
 static final long[] jjtoSkip = {
    0x80L, 
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/Token.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/Token.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/Token.java	(working copy)
@@ -128,4 +128,4 @@
   }
 
 }
-/* JavaCC - OriginalChecksum=c1e1418b35aa9e47ef8dc98b87423d70 (do not edit this line) */
+/* JavaCC - OriginalChecksum=405bb5d2fcd84e94ac1c8f0b12c1f914 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/TokenMgrError.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/TokenMgrError.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/TokenMgrError.java	(working copy)
@@ -144,4 +144,4 @@
     this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
   }
 }
-/* JavaCC - OriginalChecksum=0c275864a1972d9a01601ab81426872d (do not edit this line) */
+/* JavaCC - OriginalChecksum=f433e1a52b8eadbf12f3fbbbf87fd140 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java	(working copy)
@@ -112,4 +112,4 @@
   void Done();
 
 }
-/* JavaCC - OriginalChecksum=c95f1720d9b38046dc5d294b741c44cb (do not edit this line) */
+/* JavaCC - OriginalChecksum=53b2ec7502d50e2290e86187a6c01270 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java	(working copy)
@@ -187,4 +187,4 @@
    }
 
 }
-/* JavaCC - OriginalChecksum=81401c29cf6f9909761c636b4778ccc0 (do not edit this line) */
+/* JavaCC - OriginalChecksum=4263a02db9988d7a863aa97ad2f6dc67 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java	(working copy)
@@ -19,6 +19,7 @@
 
 import java.io.StringReader;
 import java.util.Vector;
+import java.util.Arrays;
 import org.apache.lucene.queryparser.flexible.messages.Message;
 import org.apache.lucene.queryparser.flexible.messages.MessageImpl;
 import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException;
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java	(working copy)
@@ -128,4 +128,4 @@
   }
 
 }
-/* JavaCC - OriginalChecksum=30bbd23e0dec26f141130dc62a4f6e9d (do not edit this line) */
+/* JavaCC - OriginalChecksum=ea8b1e55950603be28e2f63dcd544ab4 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java	(working copy)
@@ -144,4 +144,4 @@
     this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
   }
 }
-/* JavaCC - OriginalChecksum=3ca7fbf7de9f2424b131a5499b0a78d0 (do not edit this line) */
+/* JavaCC - OriginalChecksum=be88283d82a985d82a34dda46bcf42d5 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java	(working copy)
@@ -112,4 +112,4 @@
   void Done();
 
 }
-/* JavaCC - OriginalChecksum=5ca20c9145f29a0f8909470a7f949fe4 (do not edit this line) */
+/* JavaCC - OriginalChecksum=242ae59b965491e225a44534cbc73b42 (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java	(working copy)
@@ -184,4 +184,4 @@
    }
 
 }
-/* JavaCC - OriginalChecksum=be6f55e3bf157e8c96b4c06cca5ec81b (do not edit this line) */
+/* JavaCC - OriginalChecksum=bd8163f41bf2fd1bb00f025fce3dcaaf (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.java	(working copy)
@@ -185,7 +185,7 @@
           fieldName = jj_consume_token(TERM);
       jj_consume_token(COLON);
       if (fieldNames == null) {
-        fieldNames = new ArrayList<>();
+        fieldNames = new ArrayList<String>();
       }
       fieldNames.add(fieldName.image);
     }
@@ -211,7 +211,7 @@
       oprt = jj_consume_token(OR);
                   /* keep only last used operator */
       if (queries == null) {
-        queries = new ArrayList<>();
+        queries = new ArrayList<SrndQuery>();
         queries.add(q);
       }
       q = AndQuery();
@@ -239,7 +239,7 @@
       oprt = jj_consume_token(AND);
                    /* keep only last used operator */
       if (queries == null) {
-        queries = new ArrayList<>();
+        queries = new ArrayList<SrndQuery>();
         queries.add(q);
       }
       q = NotQuery();
@@ -267,7 +267,7 @@
       oprt = jj_consume_token(NOT);
                     /* keep only last used operator */
       if (queries == null) {
-        queries = new ArrayList<>();
+        queries = new ArrayList<SrndQuery>();
         queries.add(q);
       }
       q = NQuery();
@@ -293,7 +293,7 @@
         break label_5;
       }
       dt = jj_consume_token(N);
-      queries = new ArrayList<>();
+      queries = new ArrayList<SrndQuery>();
       queries.add(q); /* left associative */
 
       q = WQuery();
@@ -320,7 +320,7 @@
         break label_6;
       }
       wt = jj_consume_token(W);
-      queries = new ArrayList<>();
+      queries = new ArrayList<SrndQuery>();
       queries.add(q); /* left associative */
 
       q = PrimaryQuery();
@@ -401,7 +401,7 @@
 
   final public List<SrndQuery> FieldsQueryList() throws ParseException {
   SrndQuery q;
-  ArrayList<SrndQuery> queries = new ArrayList<>();
+  ArrayList<SrndQuery> queries = new ArrayList<SrndQuery>();
     jj_consume_token(LPAREN);
     q = FieldsQuery();
                      queries.add(q);
@@ -644,7 +644,7 @@
       return (jj_ntk = jj_nt.kind);
   }
 
-  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<>();
+  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
   private int[] jj_expentry;
   private int jj_kind = -1;
   private int[] jj_lasttokens = new int[100];
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java	(working copy)
@@ -128,4 +128,4 @@
   }
 
 }
-/* JavaCC - OriginalChecksum=db38f23b3674db52ff034369707a0ac3 (do not edit this line) */
+/* JavaCC - OriginalChecksum=f2df701e24da1cf2d025118ce6efdd2f (do not edit this line) */
Index: lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java
===================================================================
--- lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java	(revision 1662995)
+++ lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java	(working copy)
@@ -144,4 +144,4 @@
     this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
   }
 }
-/* JavaCC - OriginalChecksum=dcdd5ccde13b91bcd8f76a86ca618852 (do not edit this line) */
+/* JavaCC - OriginalChecksum=8c69a370d9a9893140562c8bb911678c (do not edit this line) */
Index: lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
===================================================================
--- lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java	(revision 1662995)
+++ lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java	(working copy)
@@ -33,6 +33,7 @@
 import org.apache.lucene.queryparser.flexible.standard.CommonQueryParserConfiguration;
 import org.apache.lucene.queryparser.util.QueryParserTestBase;
 import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanClause.Occur;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.MultiPhraseQuery;
 import org.apache.lucene.search.Query;
@@ -490,4 +491,41 @@
     assertEquals(expected, qp.parse("\"中国\"~3^2"));
   }
   
+  public void testSimpleFilter() throws Exception {
+    BooleanQuery expected = new BooleanQuery();
+    expected.add(new TermQuery(new Term("field", "term")), Occur.SHOULD);
+    expected.add(new TermQuery(new Term("field2", "term2")), Occur.FILTER);
+    
+    QueryParser qp = getParser(new MockAnalyzer(random()));
+    assertEquals(expected, qp.parse("field:term #field2:term2"));
+    assertEquals(expected, qp.parse("field:term #(field2:term2)"));
+    assertEquals(expected, qp.parse("field:term WHERE field2:term2"));
+    assertEquals(expected, qp.parse("field:term WHERE (field2:term2)"));
+  }
+  
+  public void testSimpleFilter2() throws Exception {
+    BooleanQuery expected = new BooleanQuery();
+    expected.add(new TermQuery(new Term("field", "term")), Occur.SHOULD);
+    BooleanQuery filter = new BooleanQuery();
+    filter.add(new TermQuery(new Term("field2", "term2")), Occur.MUST);
+    filter.add(new TermQuery(new Term("field3", "term3")), Occur.MUST);
+    expected.add(filter, Occur.FILTER);
+    
+    QueryParser qp = getParser(new MockAnalyzer(random()));
+    assertEquals(expected, qp.parse("field:term #(+field2:term2 +field3:term3)"));
+    assertEquals(expected, qp.parse("field:term WHERE (field2:term2 AND field3:term3)"));
+    assertEquals(expected, qp.parse("field:term WHERE (+field2:term2 +field3:term3)"));
+  }
+  
+  public void testSimpleFilter3() throws Exception {
+    BooleanQuery expected = new BooleanQuery();
+    expected.add(new TermQuery(new Term("field", "term")), Occur.SHOULD);
+    expected.add(new TermQuery(new Term("field2", "term2")), Occur.SHOULD);
+    expected.add(new TermQuery(new Term("field3", "term3")), Occur.FILTER);
+    
+    QueryParser qp = getParser(new MockAnalyzer(random()));
+    assertEquals(expected, qp.parse("field:term OR field2:term2 WHERE field3:term3"));
+    assertEquals(expected, qp.parse("field:term field2:term2 #field3:term3"));
+  }
+  
 }
