Class ManagedStopFilterFactory
- java.lang.Object
-
- org.apache.lucene.analysis.util.AbstractAnalysisFactory
-
- org.apache.lucene.analysis.util.TokenFilterFactory
-
- org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory
-
- org.apache.solr.rest.schema.analysis.ManagedStopFilterFactory
-
- All Implemented Interfaces:
org.apache.lucene.analysis.util.ResourceLoaderAware
,ManagedResourceObserver
public class ManagedStopFilterFactory extends BaseManagedTokenFilterFactory
TokenFilterFactory that uses the ManagedWordSetResource implementation for managing stop words using the REST API.- Since:
- 4.8.0
- SPI Name (Note: This is case-insensitive. e.g., if the name is 'htmlStrip', 'htmlstrip' can be used when looking up the service):
- "managedStop"
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME
SPI name-
Fields inherited from class org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory
handle
-
-
Constructor Summary
Constructors Constructor Description ManagedStopFilterFactory(Map<String,String> args)
Initialize the managed "handle"
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.lucene.analysis.TokenStream
create(org.apache.lucene.analysis.TokenStream input)
Returns a StopFilter based on our managed stop word set.protected Class<? extends ManagedResource>
getManagedResourceImplClass()
Returns the implementation class for managing stop words.String
getResourceId()
This analysis component knows the most logical "path" for which to manage stop words from.void
onManagedResourceInitialized(NamedList<?> args, ManagedResource res)
Callback invoked by theManagedResource
instance to trigger this class to create the CharArraySet used to create the StopFilter using the wordset managed byManagedWordSetResource
.-
Methods inherited from class org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory
inform
-
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
-
-
-
-
Field Detail
-
NAME
public static final String NAME
SPI name- See Also:
- Constant Field Values
-
-
Method Detail
-
getResourceId
public String getResourceId()
This analysis component knows the most logical "path" for which to manage stop words from.- Specified by:
getResourceId
in classBaseManagedTokenFilterFactory
-
getManagedResourceImplClass
protected Class<? extends ManagedResource> getManagedResourceImplClass()
Returns the implementation class for managing stop words.- Specified by:
getManagedResourceImplClass
in classBaseManagedTokenFilterFactory
-
onManagedResourceInitialized
public void onManagedResourceInitialized(NamedList<?> args, ManagedResource res) throws SolrException
Callback invoked by theManagedResource
instance to trigger this class to create the CharArraySet used to create the StopFilter using the wordset managed byManagedWordSetResource
. Keep in mind that a schema.xml may reuse the sameManagedStopFilterFactory
many times for different field types; behind the scenes all instances of this class/handle combination share the same managed data, hence the need for a listener/callback scheme.- Throws:
SolrException
-
create
public org.apache.lucene.analysis.TokenStream create(org.apache.lucene.analysis.TokenStream input)
Returns a StopFilter based on our managed stop word set.- Specified by:
create
in classorg.apache.lucene.analysis.util.TokenFilterFactory
-
-