Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-3283 PingRequestHandler make qt optional

David Wayne Smiley93522a23fdb7
diff --git a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
index 5013e00a72a..d46beeb7642 100644
--- a/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/PingRequestHandler.java
@@ -39,7 +39,6 @@ public class PingRequestHandler extends RequestHandlerBase
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
{
SolrParams params = req.getParams();
- SolrParams required = params.required();
SolrCore core = req.getCore();
// Check if the service is available
@@ -49,11 +48,11 @@ public class PingRequestHandler extends RequestHandlerBase
}
// Get the RequestHandler
- String qt = required.get( CommonParams.QT );
+ String qt = params.get( CommonParams.QT );//optional; you get the default otherwise
SolrRequestHandler handler = core.getRequestHandler( qt );
if( handler == null ) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
- "Unknown RequestHandler: "+qt );
+ "Unknown RequestHandler (qt): "+qt );
}
if( handler instanceof PingRequestHandler ) {
diff --git a/solr/example/solr/conf/solrconfig.xml b/solr/example/solr/conf/solrconfig.xml
index f7651a9d171..c8ea9a385da 100755
--- a/solr/example/solr/conf/solrconfig.xml
+++ b/solr/example/solr/conf/solrconfig.xml
@@ -1040,7 +1040,6 @@
<!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
- <str name="qt">search</str>
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">