SOLR-3283 PingRequestHandler make qt optional

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1306703 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David Wayne Smiley 2012-03-29 03:38:21 +00:00
parent 859814a06f
commit 93522a23fd
2 changed files with 2 additions and 4 deletions

View File

@ -39,7 +39,6 @@ public class PingRequestHandler extends RequestHandlerBase
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
{ {
SolrParams params = req.getParams(); SolrParams params = req.getParams();
SolrParams required = params.required();
SolrCore core = req.getCore(); SolrCore core = req.getCore();
// Check if the service is available // Check if the service is available
@ -49,11 +48,11 @@ public class PingRequestHandler extends RequestHandlerBase
} }
// Get the RequestHandler // 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 ); SolrRequestHandler handler = core.getRequestHandler( qt );
if( handler == null ) { if( handler == null ) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
"Unknown RequestHandler: "+qt ); "Unknown RequestHandler (qt): "+qt );
} }
if( handler instanceof PingRequestHandler ) { if( handler instanceof PingRequestHandler ) {

View File

@ -1040,7 +1040,6 @@
<!-- ping/healthcheck --> <!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="solr.PingRequestHandler"> <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants"> <lst name="invariants">
<str name="qt">search</str>
<str name="q">solrpingquery</str> <str name="q">solrpingquery</str>
</lst> </lst>
<lst name="defaults"> <lst name="defaults">