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 String
IGNORE_CASE_INIT_ARG
static String
WORD_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 Object
applyUpdatesToManagedData(Object updates)
Applies updates to the word set being managed by this resource.void
doDeleteChild(BaseSolrResource endpoint, String childId)
Deletes words managed by this resource.void
doGet(BaseSolrResource endpoint, String childId)
Implements the GET request to provide the list of words to the client.boolean
getIgnoreCase()
Returns the boolean value of theIGNORE_CASE_INIT_ARG
init arg, or the default value (false) if it has not been specifiedboolean
getIgnoreCase(org.apache.solr.common.util.NamedList<?> initArgs)
Returns the boolean value of theIGNORE_CASE_INIT_ARG
init 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 void
onManagedDataLoadedFromStorage(org.apache.solr.common.util.NamedList<?> initArgs, Object data)
Invoked when loading data from storage to initialize the list of words managed by this instance.protected boolean
updateInitArgs(org.apache.solr.common.util.NamedList<?> updatedArgs)
Called fromManagedResource.doPut(BaseSolrResource,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 org.apache.solr.common.SolrException
- Throws:
org.apache.solr.common.SolrException
-
-
Method Detail
-
getIgnoreCase
public boolean getIgnoreCase()
Returns the boolean value of theIGNORE_CASE_INIT_ARG
init arg, or the default value (false) if it has not been specified
-
getIgnoreCase
public boolean getIgnoreCase(org.apache.solr.common.util.NamedList<?> initArgs)
Returns the boolean value of theIGNORE_CASE_INIT_ARG
init arg, or the default value (false) if it has not been specified
-
onManagedDataLoadedFromStorage
protected void onManagedDataLoadedFromStorage(org.apache.solr.common.util.NamedList<?> initArgs, Object data) throws org.apache.solr.common.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:
onManagedDataLoadedFromStorage
in classManagedResource
- Throws:
org.apache.solr.common.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:
doGet
in classManagedResource
-
doDeleteChild
public void doDeleteChild(BaseSolrResource endpoint, String childId)
Deletes words managed by this resource.- Specified by:
doDeleteChild
in classManagedResource
-
applyUpdatesToManagedData
protected Object applyUpdatesToManagedData(Object updates)
Applies updates to the word set being managed by this resource.- Specified by:
applyUpdatesToManagedData
in classManagedResource
-
updateInitArgs
protected boolean updateInitArgs(org.apache.solr.common.util.NamedList<?> updatedArgs)
Description copied from class:ManagedResource
Called fromManagedResource.doPut(BaseSolrResource,Object)
to update this resource's init args using the given updatedArgs- Overrides:
updateInitArgs
in classManagedResource
-
-