/** * Returns the param, or the default if it's empty or not specified. * @deprecated use SolrParam.get(String,String) */ public static String getParam(SolrQueryRequest req, String param, String def) { String v = req.getParam(param); // Note: parameters passed but given only white-space value are // considered equivalent to passing nothing for that parameter. if (null == v || "".equals(v.trim())) { return def; } return v; }
/** * Treats parameter value as a boolean. The string 'false' is false; * any other non-empty string is true. * @deprecated use SolrParam.getBool(String,boolean) */ public static boolean getBooleanParam(SolrQueryRequest req, String param, boolean def) { String v = req.getParam(param); if (null == v || "".equals(v.trim())) { return def; } return !"false".equals(v.trim()); }
/** * Treats the param value as a Number, returns the default if nothing is * there or if it's not a number. * @deprecated use SolrParam.getFloat(String,float) */ public static Number getNumberParam(SolrQueryRequest req, String param, Number def) { Number r = def; String v = req.getParam(param); if (null == v || "".equals(v.trim())) { return r; } try { r = new Float(v); } catch (NumberFormatException e) { /* :NOOP" */ } return r; }
String fl = req.getParam("fl"); int flags=0; if (fl != null) {
String otherQueryS = req.getParam("explainOther"); if (otherQueryS != null && otherQueryS.length() > 0) { DocList otherResults = doSimpleQuery