mirror of https://github.com/apache/lucene.git
SOLR-3283 PingRequestHandler make qt optional
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1306140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d5fd5562cb
commit
b083a2f530
|
@ -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 ) {
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue