private static class SpellCheckComponent.SpellCheckerListener extends java.lang.Object implements SolrEventListener
Modifier and Type | Field and Description |
---|---|
private boolean |
buildOnCommit |
private boolean |
buildOnOptimize |
private SolrSpellChecker |
checker |
private SolrCore |
core |
log
Constructor and Description |
---|
SpellCheckerListener(SolrCore core,
SolrSpellChecker checker,
boolean buildOnCommit,
boolean buildOnOptimize) |
Modifier and Type | Method and Description |
---|---|
private void |
buildSpellIndex(SolrIndexSearcher newSearcher) |
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() |
private final SolrCore core
private final SolrSpellChecker checker
private final boolean buildOnCommit
private final boolean buildOnOptimize
public SpellCheckerListener(SolrCore core, SolrSpellChecker checker, boolean buildOnCommit, boolean buildOnOptimize)
public void init(NamedList args)
init
in interface NamedListInitializedPlugin
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher)
SolrEventListener
EventParams.EVENT
parameter and set it to a value of either:
EventParams.FIRST_SEARCHER
- First Searcher eventEventParams.NEW_SEARCHER
- New Searcher eventif (currentSearcher != null) { nlst.add(CommonParams.EVENT, CommonParams.NEW_SEARCHER); } else { nlst.add(CommonParams.EVENT, CommonParams.FIRST_SEARCHER); }
newSearcher
in interface SolrEventListener
newSearcher
- The new SolrIndexSearcher
to usecurrentSearcher
- The existing SolrIndexSearcher
. null if this is a firstSearcher event.AbstractSolrEventListener.addEventParms(org.apache.solr.search.SolrIndexSearcher, org.apache.solr.common.util.NamedList)
private void buildSpellIndex(SolrIndexSearcher newSearcher)
public void postCommit()
postCommit
in interface SolrEventListener