Class ManagedWordSetResource
- java.lang.Object
-
- org.apache.solr.rest.ManagedResource
-
- org.apache.solr.rest.schema.analysis.ManagedWordSetResource
-
- All Implemented Interfaces:
ManagedResource.ChildResourceSupport
public class ManagedWordSetResource extends ManagedResource implements ManagedResource.ChildResourceSupport
ManagedResource implementation for managing a set of words using the REST API; useful for managing stop words and/or protected words for analysis components like the KeywordMarkerFilter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.rest.ManagedResource
ManagedResource.ChildResourceSupport
-
-
Field Summary
Fields Modifier and Type Field Description static StringIGNORE_CASE_INIT_ARGstatic StringWORD_SET_JSON_FIELD-
Fields inherited from class org.apache.solr.rest.ManagedResource
INIT_ARGS_JSON_FIELD, INITIALIZED_ON_JSON_FIELD, initializedOn, lastUpdateSinceInitialization, MANAGED_JSON_LIST_FIELD, MANAGED_JSON_MAP_FIELD, managedInitArgs, solrResourceLoader, storage, UPDATED_SINCE_INIT_JSON_FIELD
-
-
Constructor Summary
Constructors Constructor Description ManagedWordSetResource(String resourceId, SolrResourceLoader loader, ManagedResourceStorage.StorageIO storageIO)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectapplyUpdatesToManagedData(Object updates)Applies updates to the word set being managed by this resource.voiddoDeleteChild(BaseSolrResource endpoint, String childId)Deletes words managed by this resource.voiddoGet(BaseSolrResource endpoint, String childId)Implements the GET request to provide the list of words to the client.booleangetIgnoreCase()Returns the boolean value of theIGNORE_CASE_INIT_ARGinit arg, or the default value (false) if it has not been specifiedbooleangetIgnoreCase(NamedList<?> initArgs)Returns the boolean value of theIGNORE_CASE_INIT_ARGinit arg, or the default value (false) if it has not been specifiedSet<String>getWordSet()Returns the set of words in this managed word set.protected voidonManagedDataLoadedFromStorage(NamedList<?> initArgs, Object data)Invoked when loading data from storage to initialize the list of words managed by this instance.protected booleanupdateInitArgs(NamedList<?> updatedArgs)Called fromManagedResource.doPut(BaseSolrResource,Representation,Object)to update this resource's init args using the given updatedArgs-
Methods inherited from class org.apache.solr.rest.ManagedResource
buildMapToStore, convertNamedListToMap, createStorage, doPost, doPut, getInitializedOn, getResourceId, getResourceLoader, getServerResourceClass, getUpdatedSinceInitialization, hasChangesSinceInitialization, loadManagedDataAndNotify, notifyObserversDuringInit, onResourceDeleted, processStoredData, reloadFromStorage, storeManagedData
-
-
-
-
Field Detail
-
WORD_SET_JSON_FIELD
public static final String WORD_SET_JSON_FIELD
- See Also:
- Constant Field Values
-
IGNORE_CASE_INIT_ARG
public static final String IGNORE_CASE_INIT_ARG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ManagedWordSetResource
public ManagedWordSetResource(String resourceId, SolrResourceLoader loader, ManagedResourceStorage.StorageIO storageIO) throws SolrException
- Throws:
SolrException
-
-
Method Detail
-
getIgnoreCase
public boolean getIgnoreCase()
Returns the boolean value of theIGNORE_CASE_INIT_ARGinit arg, or the default value (false) if it has not been specified
-
getIgnoreCase
public boolean getIgnoreCase(NamedList<?> initArgs)
Returns the boolean value of theIGNORE_CASE_INIT_ARGinit arg, or the default value (false) if it has not been specified
-
onManagedDataLoadedFromStorage
protected void onManagedDataLoadedFromStorage(NamedList<?> initArgs, Object data) throws SolrException
Invoked when loading data from storage to initialize the list of words managed by this instance. A load of the data can happen many times throughout the life cycle of this object.- Specified by:
onManagedDataLoadedFromStoragein classManagedResource- Throws:
SolrException
-
doGet
public void doGet(BaseSolrResource endpoint, String childId)
Implements the GET request to provide the list of words to the client. Alternatively, if a specific word is requested, then it is returned or a 404 is raised, indicating that the requested word does not exist.- Specified by:
doGetin classManagedResource
-
doDeleteChild
public void doDeleteChild(BaseSolrResource endpoint, String childId)
Deletes words managed by this resource.- Specified by:
doDeleteChildin classManagedResource
-
applyUpdatesToManagedData
protected Object applyUpdatesToManagedData(Object updates)
Applies updates to the word set being managed by this resource.- Specified by:
applyUpdatesToManagedDatain classManagedResource
-
updateInitArgs
protected boolean updateInitArgs(NamedList<?> updatedArgs)
Description copied from class:ManagedResourceCalled fromManagedResource.doPut(BaseSolrResource,Representation,Object)to update this resource's init args using the given updatedArgs- Overrides:
updateInitArgsin classManagedResource
-
-