| diff --git a/lucene/queryparser/build.xml b/lucene/queryparser/build.xml |
| index b6e43c2ce26..dd188865394 100644 |
| --- a/lucene/queryparser/build.xml |
| +++ b/lucene/queryparser/build.xml |
| @@ -57,6 +57,13 @@ |
| <replaceregexp match="^\Qpublic class\E" replace="@SuppressWarnings("cast")${line.separator}\0" flags="m" encoding="UTF-8"> |
| <fileset dir="@{dir}" includes="*TokenManager.java"/> |
| </replaceregexp> |
| + <!-- remove unused imports from TokenManager --> |
| + <replaceregexp byline="false" |
| + flags="gs" |
| + match="import.+?\/\*\*" |
| + replace="${line.separator}/**"> |
| + <fileset dir="@{dir}" includes="*TokenManager.java"/> |
| + </replaceregexp> |
| </sequential> |
| </macrodef> |
| |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java |
| index ab149a69a30..15b8245acf3 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/CharStream.java |
| @@ -112,4 +112,4 @@ interface CharStream { |
| void Done(); |
| |
| } |
| -/* JavaCC - OriginalChecksum=c95f1720d9b38046dc5d294b741c44cb (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=53b2ec7502d50e2290e86187a6c01270 (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java |
| index c3511a178a4..07ebe1b3582 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/ParseException.java |
| @@ -187,4 +187,4 @@ public class ParseException extends QueryNodeParseException { |
| } |
| |
| } |
| -/* JavaCC - OriginalChecksum=81401c29cf6f9909761c636b4778ccc0 (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=4263a02db9988d7a863aa97ad2f6dc67 (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java |
| index 6008bcc3dc0..30826f61dea 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.java |
| @@ -1,23 +1,6 @@ |
| /* Generated By:JavaCC: Do not edit this line. StandardSyntaxParser.java */ |
| package org.apache.lucene.queryparser.flexible.standard.parser; |
| |
| -/* |
| - * Licensed to the Apache Software Foundation (ASF) under one or more |
| - * contributor license agreements. See the NOTICE file distributed with |
| - * this work for additional information regarding copyright ownership. |
| - * The ASF licenses this file to You under the Apache License, Version 2.0 |
| - * (the "License"); you may not use this file except in compliance with |
| - * the License. You may obtain a copy of the License at |
| - * |
| - * http://www.apache.org/licenses/LICENSE-2.0 |
| - * |
| - * Unless required by applicable law or agreed to in writing, software |
| - * distributed under the License is distributed on an "AS IS" BASIS, |
| - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| - * See the License for the specific language governing permissions and |
| - * limitations under the License. |
| - */ |
| - |
| import java.io.StringReader; |
| import java.util.Vector; |
| import java.util.Arrays; |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj |
| index 8803618ab61..b6f5da29ac6 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj |
| @@ -1,14 +1,3 @@ |
| -options { |
| - STATIC=false; |
| - JAVA_UNICODE_ESCAPE=true; |
| - USER_CHAR_STREAM=true; |
| - IGNORE_CASE=false; |
| - JDK_VERSION="1.5"; |
| -} |
| - |
| -PARSER_BEGIN(StandardSyntaxParser) |
| -package org.apache.lucene.queryparser.flexible.standard.parser; |
| - |
| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| @@ -26,6 +15,17 @@ package org.apache.lucene.queryparser.flexible.standard.parser; |
| * limitations under the License. |
| */ |
| |
| +options { |
| + STATIC=false; |
| + JAVA_UNICODE_ESCAPE=true; |
| + USER_CHAR_STREAM=true; |
| + IGNORE_CASE=false; |
| + JDK_VERSION="1.5"; |
| +} |
| + |
| +PARSER_BEGIN(StandardSyntaxParser) |
| +package org.apache.lucene.queryparser.flexible.standard.parser; |
| + |
| import java.io.StringReader; |
| import java.util.Vector; |
| import java.util.Arrays; |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java |
| index 2758bed1a63..503d3c160ce 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java |
| @@ -1,21 +1,5 @@ |
| /* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserTokenManager.java */ |
| package org.apache.lucene.queryparser.flexible.standard.parser; |
| -/* |
| - * Licensed to the Apache Software Foundation (ASF) under one or more |
| - * contributor license agreements. See the NOTICE file distributed with |
| - * this work for additional information regarding copyright ownership. |
| - * The ASF licenses this file to You under the Apache License, Version 2.0 |
| - * (the "License"); you may not use this file except in compliance with |
| - * the License. You may obtain a copy of the License at |
| - * |
| - * http://www.apache.org/licenses/LICENSE-2.0 |
| - * |
| - * Unless required by applicable law or agreed to in writing, software |
| - * distributed under the License is distributed on an "AS IS" BASIS, |
| - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| - * See the License for the specific language governing permissions and |
| - * limitations under the License. |
| - */ |
| |
| /** Token Manager. */ |
| @SuppressWarnings("cast") |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java |
| index fd3340208de..95e66bbb28f 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/Token.java |
| @@ -128,4 +128,4 @@ public class Token implements java.io.Serializable { |
| } |
| |
| } |
| -/* JavaCC - OriginalChecksum=30bbd23e0dec26f141130dc62a4f6e9d (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=ea8b1e55950603be28e2f63dcd544ab4 (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java |
| index f2ef4a57eb3..e24a62bf0b1 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/TokenMgrError.java |
| @@ -144,4 +144,4 @@ public class TokenMgrError extends Error |
| 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) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java |
| index 1756f862194..31f3ad7950e 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/CharStream.java |
| @@ -112,4 +112,4 @@ interface CharStream { |
| void Done(); |
| |
| } |
| -/* JavaCC - OriginalChecksum=5ca20c9145f29a0f8909470a7f949fe4 (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=242ae59b965491e225a44534cbc73b42 (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java |
| index 4059bda68cc..d49bc79207b 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/ParseException.java |
| @@ -184,4 +184,4 @@ public class ParseException extends Exception { |
| } |
| |
| } |
| -/* JavaCC - OriginalChecksum=be6f55e3bf157e8c96b4c06cca5ec81b (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=bd8163f41bf2fd1bb00f025fce3dcaaf (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj |
| index 787ed16bde4..e29a118b91a 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj |
| @@ -35,8 +35,6 @@ import java.util.List; |
| import java.io.StringReader; |
| |
| |
| -import org.apache.lucene.analysis.TokenStream; |
| - |
| import org.apache.lucene.queryparser.surround.query.SrndQuery; |
| import org.apache.lucene.queryparser.surround.query.FieldsQuery; |
| import org.apache.lucene.queryparser.surround.query.OrQuery; |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java |
| index fd715506d26..d6736f8a01e 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/Token.java |
| @@ -128,4 +128,4 @@ public class Token implements java.io.Serializable { |
| } |
| |
| } |
| -/* JavaCC - OriginalChecksum=db38f23b3674db52ff034369707a0ac3 (do not edit this line) */ |
| +/* JavaCC - OriginalChecksum=f2df701e24da1cf2d025118ce6efdd2f (do not edit this line) */ |
| diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java |
| index 77e740f34ba..8b8727d50db 100644 |
| --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java |
| +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/TokenMgrError.java |
| @@ -144,4 +144,4 @@ public class TokenMgrError extends Error |
| 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) */ |
| diff --git a/solr/core/build.xml b/solr/core/build.xml |
| index 3c3d28a6d59..bcdd52277dd 100644 |
| --- a/solr/core/build.xml |
| +++ b/solr/core/build.xml |
| @@ -92,6 +92,19 @@ |
| byline="true" |
| match="final private LookaheadSuccess jj_ls =" |
| replace="static final private LookaheadSuccess jj_ls =" /> |
| + <!-- remove deprecated methods generated by JavaCC --> |
| + <replaceregexp file="src/java/org/apache/solr/parser/CharStream.java" |
| + byline="false" |
| + flags="gs" |
| + match="${line.separator} @Deprecated.+?;${line.separator}" |
| + replace=""/> |
| + <!-- remove unused imports from TokenManager --> |
| + <replaceregexp file="src/java/org/apache/solr/parser/QueryParserTokenManager.java" |
| + byline="false" |
| + flags="gs" |
| + match="import.+?\/\*\*" |
| + replace="${line.separator}/**"/> |
| + |
| <replace token="StringBuffer" value="StringBuilder" encoding="UTF-8"> |
| <fileset dir="src/java/org/apache/solr/parser" includes="ParseException.java TokenMgrError.java"/> |
| </replace> |
| diff --git a/solr/core/src/java/org/apache/solr/parser/QueryParser.java b/solr/core/src/java/org/apache/solr/parser/QueryParser.java |
| index 518cdefaa79..5030c3bd647 100644 |
| --- a/solr/core/src/java/org/apache/solr/parser/QueryParser.java |
| +++ b/solr/core/src/java/org/apache/solr/parser/QueryParser.java |
| @@ -616,11 +616,6 @@ public class QueryParser extends SolrQueryParserBase implements QueryParserConst |
| finally { jj_save(2, xla); } |
| } |
| |
| - private boolean jj_3R_7() { |
| - if (jj_scan_token(TERM)) return true; |
| - return false; |
| - } |
| - |
| private boolean jj_3R_4() { |
| if (jj_scan_token(TERM)) return true; |
| if (jj_scan_token(COLON)) return true; |
| @@ -672,6 +667,11 @@ public class QueryParser extends SolrQueryParserBase implements QueryParserConst |
| return false; |
| } |
| |
| + private boolean jj_3R_7() { |
| + if (jj_scan_token(TERM)) return true; |
| + return false; |
| + } |
| + |
| /** Generated Token Manager. */ |
| public QueryParserTokenManager token_source; |
| /** Current token. */ |
| diff --git a/solr/core/src/java/org/apache/solr/parser/QueryParser.jj b/solr/core/src/java/org/apache/solr/parser/QueryParser.jj |
| index 58adcd9bc58..08479288585 100644 |
| --- a/solr/core/src/java/org/apache/solr/parser/QueryParser.jj |
| +++ b/solr/core/src/java/org/apache/solr/parser/QueryParser.jj |
| @@ -76,13 +76,14 @@ public class QueryParser extends SolrQueryParserBase { |
| |
| @Override |
| protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, |
| - boolean quoted, boolean fieldAutoGenPhraseQueries, boolean fieldEnableGraphQueries) |
| + boolean quoted, boolean fieldAutoGenPhraseQueries, boolean fieldEnableGraphQueries, |
| + SynonymQueryStyle synonymQueryStyle) |
| throws SyntaxError { |
| setAutoGenerateMultiTermSynonymsPhraseQuery(fieldAutoGenPhraseQueries || getAutoGeneratePhraseQueries()); |
| // Don't auto-quote graph-aware field queries |
| boolean treatAsQuoted = getSplitOnWhitespace() |
| ? (quoted || fieldAutoGenPhraseQueries || getAutoGeneratePhraseQueries()) : quoted; |
| - return super.newFieldQuery(analyzer, field, queryText, treatAsQuoted, false, fieldEnableGraphQueries); |
| + return super.newFieldQuery(analyzer, field, queryText, treatAsQuoted, false, fieldEnableGraphQueries, synonymQueryStyle); |
| } |
| } |
| |