public class QueryParsing { public static final String OP = "q.op"; // the SolrParam used to override the QueryParser "default operator" public static final String V = "v"; // value of this parameter public static final String F = "f"; // field that a query or command pertains to public static final String TYPE = "type";// type of this query or command public static final String DEFTYPE = "defType"; // default type for any direct subqueries public static final String LOCALPARAM_START = "{!"; public static final char LOCALPARAM_END = '}'; public static final String DOCID = "_docid_"; public static final String SCORE = "score"; // true if the value was specified by the "v" param (i.e. v=myval, or v=$param) public static final String VAL_EXPLICIT = "__VAL_EXPLICIT__"; /** * Returns the "prefered" default operator for use by Query Parsers, * based on the settings in the IndexSchema which may be overridden using * an optional String override value. * * @see IndexSchema#getQueryParserDefaultOperator() * @see #OP */ public static Operator getQueryParserDefaultOperator(final IndexSchema sch, final String override) { String val = override; if (null == val) val = sch.getQueryParserDefaultOperator(); return "AND".equals(val) ? Operator.AND : Operator.OR; } // ... }