diff --git a/solr/src/java/org/apache/solr/core/SolrCore.java b/solr/src/java/org/apache/solr/core/SolrCore.java index 559838b4f18..4ca31da400e 100644 --- a/solr/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/src/java/org/apache/solr/core/SolrCore.java @@ -1375,18 +1375,7 @@ public final class SolrCore implements SolrInfoMBean { } - /** - * @deprecated Use {@link #execute(SolrRequestHandler, SolrQueryRequest, SolrQueryResponse)} instead. - */ - @Deprecated - public void execute(SolrQueryRequest req, SolrQueryResponse rsp) { - SolrRequestHandler handler = getRequestHandler(req.getQueryType()); - if (handler==null) { - log.warn(logid+"Unknown Request Handler '" + req.getQueryType() +"' :" + req); - throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"Unknown Request Handler '" + req.getQueryType() + "'", true); - } - execute(handler, req, rsp); - } + public static void setResponseHeaderValues(SolrRequestHandler handler, SolrQueryRequest req, SolrQueryResponse rsp) { // TODO should check that responseHeader has not been replaced by handler diff --git a/solr/src/java/org/apache/solr/request/SolrQueryRequest.java b/solr/src/java/org/apache/solr/request/SolrQueryRequest.java index a7dbae45ced..25c2a5a9aa2 100644 --- a/solr/src/java/org/apache/solr/request/SolrQueryRequest.java +++ b/solr/src/java/org/apache/solr/request/SolrQueryRequest.java @@ -63,50 +63,6 @@ public interface SolrQueryRequest { */ public void close(); - /** - * Returns the input parameter value for the specified name - * @return the value, or the first value if the parameter was - * specified more then once; may be null. - * @deprecated Use {@link #getParams()} instead. - */ - @Deprecated - public String getParam(String name); - - /** - * Returns the input parameter values for the specified name - * @return the values; may be null or empty depending on implementation - * @deprecated Use {@link #getParams()} instead. - */ - @Deprecated - public String[] getParams(String name); - - /** - * Returns the primary query string parameter of the request - * @deprecated Use {@link #getParams()} and {@link CommonParams#Q} instead. - */ - @Deprecated - public String getQueryString(); - - /** - * Signifies the syntax and the handler that should be used - * to execute this query. - * @deprecated Use {@link #getParams()} and {@link CommonParams#QT} instead. - */ - @Deprecated - public String getQueryType(); - - /** starting position in matches to return to client - * @deprecated Use {@link #getParams()} and {@link CommonParams#START} instead. - */ - @Deprecated - public int getStart(); - - /** number of matching documents to return - * @deprecated Use {@link #getParams()} and {@link CommonParams#ROWS} instead. - */ - @Deprecated - public int getLimit(); - /** The start time of this request in milliseconds */ public long getStartTime(); @@ -124,11 +80,6 @@ public interface SolrQueryRequest { * Suitable for logging. */ public String getParamString(); - - /****** - // Get the current elapsed time in milliseconds - public long getElapsedTime(); - ******/ } diff --git a/solr/src/java/org/apache/solr/request/SolrQueryRequestBase.java b/solr/src/java/org/apache/solr/request/SolrQueryRequestBase.java index 4dcaafea614..6177a292412 100644 --- a/solr/src/java/org/apache/solr/request/SolrQueryRequestBase.java +++ b/solr/src/java/org/apache/solr/request/SolrQueryRequestBase.java @@ -43,32 +43,6 @@ import java.util.HashMap; * @version $Id$ */ public abstract class SolrQueryRequestBase implements SolrQueryRequest { - /** - * @deprecated Use org.apache.solr.common.params.CommonParams - */ - @Deprecated - public static final String QUERY_NAME="q"; - /** - * @deprecated Use org.apache.solr.common.params.CommonParams - */ - @Deprecated - public static final String START_NAME="start"; - /** - * @deprecated Use org.apache.solr.common.params.CommonParams - */ - @Deprecated - public static final String ROWS_NAME="rows"; - /** - * @deprecated Use org.apache.solr.common.params.CommonParams - */ - @Deprecated - public static final String XSL_NAME="xsl"; - /** - * @deprecated Use org.apache.solr.common.params.CommonParams - */ - @Deprecated - public static final String QUERYTYPE_NAME="qt"; - protected final SolrCore core; protected final SolrParams origParams; protected SolrParams params; @@ -98,99 +72,6 @@ public abstract class SolrQueryRequestBase implements SolrQueryRequest { this.params = params; } - /** - * @deprecated Use {@link #getParams()} instead. - */ - @Deprecated - public String getParam(String name) { - return params.get(name); - } - - /** - * @deprecated Use {@link #getParams()} instead. - */ - @Deprecated - public String[] getParams(String name) { - return params.getParams(name); - } - - /** - * @deprecated use getParams().required().getInt( name ) instead - */ - @Deprecated - public int getIntParam(String name) { - String s = getParam(name); - if (s==null) { - throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Missing required parameter '"+name+"' from " + this); - } - return Integer.parseInt(s); - } - - /** - * @deprecated use getParams().required().getInt( name ) instead - */ - @Deprecated - public int getIntParam(String name, int defval) { - String s = getParam(name); - return s==null ? defval : Integer.parseInt(s); - } - - /** - * @deprecated use getParams().required().getParam( name ) instead - */ - @Deprecated - public String getStrParam(String name) { - String s = getParam(name); - if (s==null) { - throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,"Missing required parameter '"+name+"' from " + this); - } - return s; - } - - /** - * @deprecated use getParams().required().getParam( name ) instead - */ - @Deprecated - public String getStrParam(String name, String defval) { - String s = getParam(name); - return s==null ? defval : s; - } - - /** - * @deprecated Use {@link #getParams()} and {@link CommonParams#Q} instead. - */ - @Deprecated - public String getQueryString() { - return params.get(CommonParams.Q); - } - - /** - * @deprecated Use {@link #getParams()} and {@link CommonParams#QT} instead. - */ - @Deprecated - public String getQueryType() { - return params.get(CommonParams.QT); - } - - /** - * starting position in matches to return to client - * @deprecated Use {@link #getParams()} and {@link CommonParams#START} instead. - */ - @Deprecated - public int getStart() { - return params.getInt(CommonParams.START, 0); - } - - /** - * number of matching documents to return - * @deprecated Use {@link #getParams()} and {@link CommonParams#ROWS} instead. - */ - @Deprecated - public int getLimit() { - return params.getInt(CommonParams.ROWS, 10); - } - - protected final long startTime=System.currentTimeMillis(); // Get the start time of this request in milliseconds public long getStartTime() { diff --git a/solr/src/java/org/apache/solr/util/SolrPluginUtils.java b/solr/src/java/org/apache/solr/util/SolrPluginUtils.java index 52173a6c3d1..bef1eb6b6f7 100644 --- a/solr/src/java/org/apache/solr/util/SolrPluginUtils.java +++ b/solr/src/java/org/apache/solr/util/SolrPluginUtils.java @@ -64,17 +64,6 @@ import java.lang.reflect.InvocationTargetException; * default parameter settings. */ public class SolrPluginUtils { - final static Logger log = LoggerFactory.getLogger( SolrPluginUtils.class ); - - /** - * Set defaults on a SolrQueryRequest. - * - * RequestHandlers can use this method to ensure their defaults are - * visible to other components such as the response writer - */ - public static void setDefaults(SolrQueryRequest req, SolrParams defaults) { - setDefaults(req, defaults, null, null); - } /** * Set default-ish params on a SolrQueryRequest. @@ -104,13 +93,6 @@ public class SolrPluginUtils { } - /** - * standard param for field list - * - * @deprecated Use org.apache.solr.common.params.CommonParams.FL. - */ - @Deprecated - public static String FL = CommonParams.FL; /** * SolrIndexSearch.numDocs(Query,Query) freaks out if the filtering @@ -123,59 +105,10 @@ public class SolrPluginUtils { } - /** - * Returns the param, or the default if it's empty or not specified. - * @deprecated use SolrParam.get(String,String) - */ - @Deprecated - 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 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) - */ - @Deprecated - 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; - } - /** - * Treats parameter value as a boolean. The string 'false' is false; - * any other non-empty string is true. - * @deprecated use SolrParam.getBool(String,boolean) - */ - @Deprecated - 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()); - } private final static Pattern splitList=Pattern.compile(",| "); @@ -451,23 +384,6 @@ public class SolrPluginUtils { return out; } - /** - * Generates an list of Explanations for each item in a list of docs. - * - * @param query The Query you want explanations in the context of - * @param docs The Documents you want explained relative that query - * @deprecated this returns the explanations as Strings, instead it - * is recommeded to use getExplanations and call toString() - * yourself, or use explanationsToNamedLists - */ - @Deprecated - public static NamedList getExplainList(Query query, DocList docs, - SolrIndexSearcher searcher, - IndexSchema schema) - throws IOException { - - return explanationsToStrings(getExplanations(query,docs,searcher,schema)); - } /** * Executes a basic query @@ -536,33 +452,6 @@ public class SolrPluginUtils { } return out; } - /** - * Given a string containing functions with optional boosts, returns - * an array of Queries representing those functions with the specified - * boosts. - *
- * NOTE: intra-function whitespace is not allowed. - *
- * @see #parseFieldBoosts - * @deprecated - */ - @Deprecated - public static List