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, 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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     

    Fields inherited from class org.apache.lucene.analysis.AbstractAnalysisFactory

    LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Default ctor for compatibility with SPI
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract Class<? extends ManagedResource>
    Let the concrete analysis component determine the ManagedResource implementation.
    protected abstract String
    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 Details

    • handle

      protected String handle
  • Constructor Details

    • BaseManagedTokenFilterFactory

      protected BaseManagedTokenFilterFactory(Map<String,String> args)
    • BaseManagedTokenFilterFactory

      public BaseManagedTokenFilterFactory()
      Default ctor for compatibility with SPI
  • Method Details

    • 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 the RestManager needs to initialize a ManagedResource 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 interface org.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.