Class ManagedSynonymFilterFactory

  • All Implemented Interfaces:
    org.apache.lucene.analysis.util.ResourceLoaderAware, ManagedResourceObserver

    public class ManagedSynonymFilterFactory
    extends BaseManagedTokenFilterFactory
    Use ManagedSynonymGraphFilterFactory instead, but be sure to also use FlattenGraphFilterFactory at index time (not at search time) as well.
    TokenFilterFactory and ManagedResource implementation for doing CRUD on synonyms using the REST API.
    SPI Name (Note: This is case-insensitive. e.g., if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service):
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ManagedSynonymFilterFactory.SynonymManager
      ManagedResource implementation for synonyms, which are so specialized that it makes sense to implement this class as an inner class as it has little application outside the SynonymFilterFactory use cases.
    • Field Summary

      Modifier and Type Field Description
      protected org.apache.lucene.analysis.synonym.SynonymFilterFactory delegate
      static String IGNORE_CASE_INIT_ARG
      static String NAME
      SPI name
      static String SYNONYM_MAPPINGS
      • Fields inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

        LUCENE_MATCH_VERSION_PARAM, luceneMatchVersion
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      org.apache.lucene.analysis.TokenStream create​(org.apache.lucene.analysis.TokenStream input)
      protected Class<? extends ManagedResource> getManagedResourceImplClass()
      Let the concrete analysis component determine the ManagedResource implementation.
      String getResourceId()
      Let the concrete analysis component decide the path it wishes to be managed at.
      void onManagedResourceInitialized​(NamedList<?> initArgs, ManagedResource res)
      Called once, during core initialization, to initialize any analysis components that depend on the data managed by this resource.
      • Methods inherited from class org.apache.lucene.analysis.util.TokenFilterFactory

        availableTokenFilters, findSPIName, forName, lookupClass, normalize, reloadTokenFilters
      • Methods inherited from class org.apache.lucene.analysis.util.AbstractAnalysisFactory

        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
    • Constructor Detail

      • ManagedSynonymFilterFactory

        public ManagedSynonymFilterFactory​(Map<String,​String> args)
    • Method Detail

      • getManagedResourceImplClass

        protected Class<? extends ManagedResource> getManagedResourceImplClass()
        Description copied from class: BaseManagedTokenFilterFactory
        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.
        Specified by:
        getManagedResourceImplClass in class BaseManagedTokenFilterFactory
      • onManagedResourceInitialized

        public void onManagedResourceInitialized​(NamedList<?> initArgs,
                                                 ManagedResource res)
                                          throws SolrException
        Called once, during core initialization, to initialize any analysis components that depend on the data managed by this resource. It is important that the analysis component is only initialized once during core initialization so that text analysis is consistent, especially in a distributed environment, as we don't want one server applying a different set of stop words than other servers.
      • create

        public org.apache.lucene.analysis.TokenStream create​(org.apache.lucene.analysis.TokenStream input)
        Specified by:
        create in class org.apache.lucene.analysis.util.TokenFilterFactory