class AbstractSolrEventListener extends java.lang.Object implements SolrEventListener
| Modifier and Type | Field and Description |
|---|---|
protected NamedList |
args |
protected SolrCore |
core |
log| Constructor and Description |
|---|
AbstractSolrEventListener(SolrCore core) |
| Modifier and Type | Method and Description |
|---|---|
protected NamedList |
addEventParms(SolrIndexSearcher currentSearcher,
NamedList nlst)
Add the
EventParams.EVENT with either the EventParams.NEW_SEARCHER
or EventParams.FIRST_SEARCHER values depending on the value of currentSearcher. |
void |
init(NamedList args) |
void |
newSearcher(SolrIndexSearcher newSearcher,
SolrIndexSearcher currentSearcher)
The searchers passed here are only guaranteed to be valid for the duration
of this method call, so care should be taken not to spawn threads or asynchronous
tasks with references to these searchers.
|
void |
postCommit() |
java.lang.String |
toString() |
public AbstractSolrEventListener(SolrCore core)
public void init(NamedList args)
init in interface NamedListInitializedPluginpublic void postCommit()
postCommit in interface SolrEventListenerpublic void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)
SolrEventListenerEventParams.EVENT parameter and set it to a value of either:
EventParams.FIRST_SEARCHER - First Searcher eventEventParams.NEW_SEARCHER - New Searcher event
if (currentSearcher != null) {
nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER);
} else {
nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER);
}
newSearcher in interface SolrEventListenernewSearcher - The new SolrIndexSearcher to usecurrentSearcher - The existing SolrIndexSearcher. null if this is a firstSearcher event.addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)public java.lang.String toString()
toString in class java.lang.Objectprotected NamedList addEventParms(SolrIndexSearcher currentSearcher, NamedList nlst)
EventParams.EVENT with either the EventParams.NEW_SEARCHER
or EventParams.FIRST_SEARCHER values depending on the value of currentSearcher.
Makes a copy of NamedList and then adds the parameters.currentSearcher - If null, add FIRST_SEARCHER, otherwise NEW_SEARCHERnlst - The named list to add the EVENT value to