public abstract class RequestHandlerBase extends java.lang.Object implements SolrRequestHandler, SolrInfoMBean
SolrInfoMBean.Category
Modifier and Type | Field and Description |
---|---|
protected SolrParams |
appends |
protected SolrParams |
defaults |
(package private) long |
handlerStart |
protected boolean |
httpCaching |
protected NamedList |
initArgs |
protected SolrParams |
invariants |
(package private) long |
numErrors |
(package private) long |
numRequests |
(package private) long |
numTimeouts |
(package private) long |
totalTime |
Constructor and Description |
---|
RequestHandlerBase() |
Modifier and Type | Method and Description |
---|---|
SolrInfoMBean.Category |
getCategory()
Purpose of this Class
|
abstract java.lang.String |
getDescription()
Simple one or two line description
|
java.net.URL[] |
getDocs()
Documentation URL list.
|
NamedList |
getInitArgs() |
java.lang.String |
getName()
Simple common usage name, e.g.
|
abstract java.lang.String |
getSource()
CVS Source, SVN Source, etc
|
abstract java.lang.String |
getSourceId()
CVS Id, SVN Id, etc
|
NamedList |
getStatistics()
Any statistics this instance would like to be publicly available via
the Solr Administration interface.
|
abstract java.lang.String |
getVersion()
Simple common usage version, e.g.
|
void |
handleRequest(SolrQueryRequest req,
SolrQueryResponse rsp)
Handles a query request, this method must be thread safe.
|
abstract void |
handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp) |
void |
init(NamedList args)
Initializes the
SolrRequestHandler by creating three SolrParams named. |
volatile long numRequests
volatile long numErrors
volatile long numTimeouts
protected NamedList initArgs
protected SolrParams defaults
protected SolrParams appends
protected SolrParams invariants
volatile long totalTime
long handlerStart
protected boolean httpCaching
public void init(NamedList args)
SolrRequestHandler
by creating three SolrParams
named.
Name | Description |
---|---|
defaults | Contains all of the named arguments contained within the list element named "defaults". |
appends | Contains all of the named arguments contained within the list element named "appends". |
invariants | Contains all of the named arguments contained within the list element named "invariants". |
<lst name="defaults"> <str name="echoParams">explicit</str> <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str> <str name="mm">2<-1 5<-2 6<90%</str> <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str> </lst> <lst name="appends"> <str name="fq">inStock:true</str> </lst> <lst name="invariants"> <str name="facet.field">cat</str> <str name="facet.field">manu_exact</str> <str name="facet.query">price:[* TO 500]</str> <str name="facet.query">price:[500 TO *]</str> </lst>
init
in interface SolrRequestHandler
args
- The NamedList
to initialize fromhandleRequest(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse)
,
handleRequestBody(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse)
,
SolrPluginUtils.setDefaults(org.apache.solr.request.SolrQueryRequest, org.apache.solr.common.params.SolrParams, org.apache.solr.common.params.SolrParams, org.apache.solr.common.params.SolrParams)
,
See also the example solrconfig.xml located in the Solr codebase (example/solr/conf).
public NamedList getInitArgs()
public abstract void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws java.lang.Exception
java.lang.Exception
public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp)
SolrRequestHandler
Information about the request may be obtained from req
and
response information may be set using rsp
.
There are no mandatory actions that handleRequest must perform. An empty handleRequest implementation would fulfill all interface obligations.
handleRequest
in interface SolrRequestHandler
public java.lang.String getName()
SolrInfoMBean
getName
in interface SolrInfoMBean
public abstract java.lang.String getDescription()
SolrInfoMBean
getDescription
in interface SolrInfoMBean
public abstract java.lang.String getSourceId()
SolrInfoMBean
getSourceId
in interface SolrInfoMBean
public abstract java.lang.String getSource()
SolrInfoMBean
getSource
in interface SolrInfoMBean
public abstract java.lang.String getVersion()
SolrInfoMBean
getVersion
in interface SolrInfoMBean
public SolrInfoMBean.Category getCategory()
SolrInfoMBean
getCategory
in interface SolrInfoMBean
public java.net.URL[] getDocs()
SolrInfoMBean
Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...
getDocs
in interface SolrInfoMBean
public NamedList getStatistics()
SolrInfoMBean
Any Object type may be stored in the list, but only the
toString()
representation will be used.
getStatistics
in interface SolrInfoMBean