public class AbstractSolrEventListener extends Object implements SolrEventListener
| 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. |
NamedList |
getArgs() |
SolrCore |
getCore() |
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() |
void |
postSoftCommit() |
String |
toString() |
public AbstractSolrEventListener(SolrCore core)
public SolrCore getCore()
public NamedList getArgs()
public void init(NamedList args)
init in interface NamedListInitializedPluginpublic void postCommit()
postCommit in interface SolrEventListenerpublic void postSoftCommit()
postSoftCommit in interface SolrEventListenerpublic void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)
SolrEventListener
Implementations should add the EventParams.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)protected 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 toCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.