org.apache.solr.core
Class AbstractSolrEventListener
java.lang.Object
org.apache.solr.core.AbstractSolrEventListener
- All Implemented Interfaces:
- SolrEventListener, NamedListInitializedPlugin
- Direct Known Subclasses:
- QuerySenderListener
public class AbstractSolrEventListener
- extends Object
- implements SolrEventListener
core
protected final SolrCore core
args
protected NamedList args
AbstractSolrEventListener
public AbstractSolrEventListener(SolrCore core)
init
public void init(NamedList args)
- Specified by:
init
in interface NamedListInitializedPlugin
postCommit
public void postCommit()
- Specified by:
postCommit
in interface SolrEventListener
postSoftCommit
public void postSoftCommit()
- Specified by:
postSoftCommit
in interface SolrEventListener
newSearcher
public void newSearcher(SolrIndexSearcher newSearcher,
SolrIndexSearcher currentSearcher)
- Description copied from interface:
SolrEventListener
- 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.
Implementations should add the
EventParams.EVENT
parameter and set it to a value of either:
Sample:
if (currentSearcher != null) {
nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER);
} else {
nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER);
}
- Specified by:
newSearcher
in interface SolrEventListener
- Parameters:
newSearcher
- The new SolrIndexSearcher
to usecurrentSearcher
- The existing SolrIndexSearcher
. null if this is a firstSearcher event.- See Also:
addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)
toString
public String toString()
- Overrides:
toString
in class Object
addEventParms
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.
Makes a copy of NamedList and then adds the parameters.
- Parameters:
currentSearcher
- If null, add FIRST_SEARCHER, otherwise NEW_SEARCHERnlst
- The named list to add the EVENT value to
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.