Package org.mycore.solr.commands
Class MCRSolrCommands
java.lang.Object
org.mycore.frontend.cli.MCRAbstractCommands
org.mycore.solr.commands.MCRSolrCommands
- All Implemented Interfaces:
MCRExternalCommandInterface
Class provides useful solr related commands.
- Author:
- shermann, Sebastian Hofmann
-
Field Summary
Fields inherited from class org.mycore.frontend.cli.MCRAbstractCommands
command
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
deleteByIdFromSolr
(String objectID, String coreID) static void
static void
dropIndexByType
(String type, String coreID) static void
This command displays the MyCoRe properties, which have to be set, to reload the current Solr / Solr Core configuration on the next start of the MyCoRe application.static void
This command optimizes the index in Solr in a given core.static void
rebuildClassificationIndex
(String coreID) static void
rebuildContentIndex
(String coreID) static void
rebuildContentIndexForSelected
(String coreID) static void
rebuildContentIndexObject
(String objectID, String coreID) static void
rebuildMetadataAndContentIndex
(String coreID) static void
rebuildMetadataIndex
(String coreID) static void
static void
rebuildMetadataIndexObject
(String object, String coreID) static void
rebuildMetadataIndexType
(String type, String coreID) static void
registerSolrCore
(String coreName, String coreID) static void
registerSolrCore
(String coreName, String server, String coreID) static void
reloadSolrConfiguration
(String configType, String coreID) This command recreates the managed-schema.xml and solrconfig.xml files.static void
selectObjectsWithSolrQuery
(String query, String coreID) static void
switchSolrCore
(String coreID1, String coreID2) static void
synchronizeMetadataIndex
(String coreID) static void
synchronizeMetadataIndex
(String objectType, String coreID) Methods inherited from class org.mycore.frontend.cli.MCRAbstractCommands
addCommand, getDisplayName, getPossibleCommands, setDisplayName
-
Constructor Details
-
MCRSolrCommands
public MCRSolrCommands()
-
-
Method Details
-
listConfig
@MCRCommand(syntax="show solr configuration", help="displays MyCoRe properties for the current Solr configuration", order=10) public static void listConfig()This command displays the MyCoRe properties, which have to be set, to reload the current Solr / Solr Core configuration on the next start of the MyCoRe application. -
registerSolrCore
-
registerSolrCore
-
switchSolrCore
-
reloadSolrConfiguration
@MCRCommand(syntax="reload solr configuration {0} in core {1}", help="reloads the schema and the configuration in Solr by using the Solr schema api for core with the id {0}", order=70) public static void reloadSolrConfiguration(String configType, String coreID) This command recreates the managed-schema.xml and solrconfig.xml files. First it removes all schema definitions, except for some MyCoRe default types and fields. Second it parses the available MyCoRe modules and components and adds / updates / deletes the schema definition. Finally it does the same for the solrconfig.xml definition. see https://github.com/MyCoRe-Org/mycore_solr_configset_main- Parameters:
coreID
- the core type of the core that should be reloaded; the MyCoRe default application coreID is main
-
rebuildMetadataAndContentIndex
@MCRCommand(syntax="rebuild solr metadata and content index in core {0}", help="rebuilds metadata and content index in Solr for core with the id {0}", order=110) public static void rebuildMetadataAndContentIndex(String coreID) throws Exception - Throws:
Exception
-
rebuildMetadataIndexType
@MCRCommand(syntax="rebuild solr metadata index for all objects of type {0} in core {1}", help="rebuilds the metadata index in Solr for all objects of type {0} in core with the id {1}", order=130) public static void rebuildMetadataIndexType(String type, String coreID) throws Exception - Throws:
Exception
-
rebuildMetadataIndexObject
@MCRCommand(syntax="rebuild solr metadata index for object {0} in core {1}", help="rebuilds metadata index in Solr for the given object in core with the id {1}", order=120) public static void rebuildMetadataIndexObject(String object, String coreID) throws Exception - Throws:
Exception
-
rebuildMetadataIndexForSelected
@MCRCommand(syntax="rebuild solr metadata index for selected in core {0}", help="rebuilds content index in Solr for selected objects and or derivates in core with the id {0}", order=140) public static void rebuildMetadataIndexForSelected(String coreID) -
rebuildMetadataIndex
@MCRCommand(syntax="rebuild solr metadata index in core {0}", help="rebuilds metadata index in Solr in core with the id {0}", order=150) public static void rebuildMetadataIndex(String coreID) -
rebuildContentIndexObject
-
rebuildContentIndexForSelected
@MCRCommand(syntax="rebuild solr content index for selected in core {0}", help="rebuilds content index in Solr for alll derivates of selected objects in core with the id {0}", order=170) public static void rebuildContentIndexForSelected(String coreID) -
rebuildContentIndex
@MCRCommand(syntax="rebuild solr content index in core {0}", help="rebuilds content index in Solr in core with the id {0}", order=180) public static void rebuildContentIndex(String coreID) -
rebuildClassificationIndex
@MCRCommand(syntax="rebuild solr classification index in core {0}", help="rebuilds classification index in Solr in the core with the id {0}", order=190) public static void rebuildClassificationIndex(String coreID) -
dropIndex
@MCRCommand(syntax="clear solr index in core {0}", help="deletes all entries from index in Solr in core with the id {0}", order=210) public static void dropIndex(String coreID) throws Exception - Throws:
Exception
-
dropIndexByType
@MCRCommand(syntax="delete from solr index all objects of type {0} in core {1}", help="deletes all objects of type {0} from index in Solr in core with the id {1}", order=220) public static void dropIndexByType(String type, String coreID) throws Exception - Throws:
Exception
-
deleteByIdFromSolr
-
selectObjectsWithSolrQuery
@MCRCommand(syntax="select objects with solr query {0} in core {1}", help="selects mcr objects with a solr query {0} in core with the id {1}", order=310) public static void selectObjectsWithSolrQuery(String query, String coreID) throws Exception - Throws:
Exception
-
optimize
@MCRCommand(syntax="optimize solr index in core {0}", help="optimizes the index in Solr in core with the id {0}. The operation works like a hard commit and forces all of the index segments to be merged into a single segment first. Depending on the use cases, this operation should be performed infrequently (e.g. nightly), since it is very expensive and involves reading and re-writing the entire index", order=410) public static void optimize(String coreID) This command optimizes the index in Solr in a given core. The operation works like a hard commit and forces all of the index segments to be merged into a single segment first. Depending on the use cases, this operation should be performed infrequently (e.g. nightly) since it is very expensive and involves reading and re-writing the entire index. -
synchronizeMetadataIndex
@MCRCommand(syntax="synchronize solr metadata index for all objects of type {0} in core {1}", help="synchronizes the MyCoRe store and index in Solr in core with the id {1} for objects of type {0}", order=420) public static void synchronizeMetadataIndex(String objectType, String coreID) throws Exception - Throws:
Exception
-
synchronizeMetadataIndex
@MCRCommand(syntax="synchronize solr metadata index in core {0}", help="synchronizes the MyCoRe store and index in Solr in core with the id {0}", order=430) public static void synchronizeMetadataIndex(String coreID) throws Exception - Throws:
Exception
-