Class BaseManagedTokenFilterFactory
- java.lang.Object
-
- org.apache.lucene.analysis.AbstractAnalysisFactory
-
- org.apache.lucene.analysis.TokenFilterFactory
-
- org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory
-
- All Implemented Interfaces:
org.apache.lucene.util.ResourceLoaderAware
,ManagedResourceObserver
- Direct Known Subclasses:
ManagedStopFilterFactory
,ManagedSynonymFilterFactory
,ManagedSynonymGraphFilterFactory
public abstract class BaseManagedTokenFilterFactory extends org.apache.lucene.analysis.TokenFilterFactory implements org.apache.lucene.util.ResourceLoaderAware, ManagedResourceObserver
Abstract based class for implementing TokenFilterFactory objects that are managed by the REST API. Specifically, this base class is useful for token filters that have configuration and data that needs to be updated programmatically, such as to support a UI for adding synonyms.- Since:
- 4.8.0
-
-
Constructor Summary
Constructors Modifier Constructor Description BaseManagedTokenFilterFactory()
Default ctor for compatibility with SPIprotected
BaseManagedTokenFilterFactory(Map<String,String> args)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Class<? extends ManagedResource>
getManagedResourceImplClass()
Let the concrete analysis component determine the ManagedResource implementation.protected abstract String
getResourceId()
Let the concrete analysis component decide the path it wishes to be managed at.void
inform(org.apache.lucene.util.ResourceLoader loader)
Registers an endpoint with the RestManager so that this component can be managed using the REST API.-
Methods inherited from class org.apache.lucene.analysis.TokenFilterFactory
availableTokenFilters, create, findSPIName, forName, lookupClass, normalize, reloadTokenFilters
-
Methods inherited from class org.apache.lucene.analysis.AbstractAnalysisFactory
defaultCtorException, get, get, get, get, get, getBoolean, getChar, getClassArg, getFloat, getInt, getLines, getLuceneMatchVersion, getOriginalArgs, getPattern, getSet, getSnowballWordSet, getWordSet, isExplicitLuceneMatchVersion, require, require, require, requireBoolean, requireChar, requireFloat, requireInt, setExplicitLuceneMatchVersion, splitAt, splitFileNames
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.rest.ManagedResourceObserver
onManagedResourceInitialized
-
-
-
-
Field Detail
-
handle
protected String handle
-
-
Method Detail
-
inform
public void inform(org.apache.lucene.util.ResourceLoader loader) throws IOException
Registers an endpoint with the RestManager so that this component can be managed using the REST API. This method can be invoked before all the resources theRestManager
needs to initialize aManagedResource
are available, so this simply registers the need to be managed at a specific endpoint and lets the RestManager deal with initialization when ready.- Specified by:
inform
in interfaceorg.apache.lucene.util.ResourceLoaderAware
- Throws:
IOException
-
getResourceId
protected abstract String getResourceId()
Let the concrete analysis component decide the path it wishes to be managed at.
-
getManagedResourceImplClass
protected abstract Class<? extends ManagedResource> getManagedResourceImplClass()
Let the concrete analysis component determine the ManagedResource implementation. As there can be many instances of the same analysis component in a schema, this class should not presume to create ManagedResource. For instance, there may be 10 instances of the ManagedStopFilterFactory that use the same set of English stop words and we don't want 10 copies of the ManagedWordSetResource in the same core.
-
-