Apache Solr open-source search software
- Renamed a few recently added variables and methods for consistency.
Otis Gospodnetic4f9dc49cfba9
diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.jj b/src/java/org/apache/lucene/queryParser/QueryParser.jjindex 543f414f165..123169d15d1 100644--- a/src/java/org/apache/lucene/queryParser/QueryParser.jj+++ b/src/java/org/apache/lucene/queryParser/QueryParser.jj@@ -159,25 +159,26 @@ public class QueryParser {// CODE ADDED BY PETER HALACSY- /** The actual mode that parses uses to parse queries */public static final int DEFAULT_OPERATOR_OR = 0;public static final int DEFAULT_OPERATOR_AND = 1;- private int mode = DEFAULT_OPERATOR_OR;+ /** The actual operator that parser uses to combine query terms */+ private int operator = DEFAULT_OPERATOR_OR;/**- * Set the mode of the QueryParser. In classic mode (<code>DEFAULT_OPERATOR_OR</mode>)- * term without any modifiers are considered optional: for example <code>- * capital of Hungary</code> is equal to <code>capital OR of OR Hungary</code>.<br/>+ * Set the boolean operator of the QueryParser.+ * In classic mode (<code>DEFAULT_OPERATOR_OR</mode>) terms without any modifiers+ * are considered optional: for example <code>capital of Hungary</code> is equal to+ * <code>capital OR of OR Hungary</code>.<br/>* In <code>DEFAULT_OPERATOR_AND</code> terms are considered to be in conjuction: the* above mentioned query is parsed as <code>capital AND of AND Hungary</code>*/- public void setMode(int mode) {- this.mode = mode;+ public void setOperator(int operaror) {+ this.operator = operator;}- public int getMode() {- return this.mode;+ public int getOperator() {+ return this.operator;}private void addClause(Vector clauses, int conj, int mods, Query q) {@@ -191,7 +192,7 @@ public class QueryParser {c.required = true;}// THIS CODE ADDED PETER HALACSY- if(mode == DEFAULT_OPERATOR_AND && conj == CONJ_OR) {+ if (operator == DEFAULT_OPERATOR_AND && conj == CONJ_OR) {// If this term is introduced by OR, make the preceding term optional,// unless it's prohibited (that means we leave -a OR b but +a OR b-->a OR b)// notice if the input is a OR b, first term is parsed as required; without@@ -207,7 +208,7 @@ public class QueryParser {if (q == null)return;- if(mode == DEFAULT_OPERATOR_OR) {+ if (operator == DEFAULT_OPERATOR_OR) {// THIS IS THE ORIGINAL CODE// We set REQUIRED if we're introduced by AND or +; PROHIBITED if// introduced by NOT or -; make sure not to set both.