Interface SolrAdminProvider
- All Superinterfaces:
SolrProvider
- All Known Implementing Classes:
DefaultSolrCloudAdminProvider
Provides basic administrative APIs for Solr. Solr and SolrJ allow for more functionality than we
provide, by default, here. This encapsulates the functionality of some basic things that are
often required. Note that most of this functionality is only provided by SolrCloud, which is an
approach to running Solr in a cluster with Zookeeper as a state manager.
- Author:
- Kelly Tisdell (ktisdell)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Check that the provider can connect to Solr.Reads a map of alias name to Solr collection name.void
recreateAlias
(String alias) The purpose of this is to empty, or delete and recreate, a collection.void
swapCollectionAliases
(String alias1, String alias2) Re-assigns the aliases to the other alias' respective collection.Methods inherited from interface com.broadleafcommerce.search.provider.solr.SolrProvider
getSolrClient
-
Method Details
-
swapCollectionAliases
void swapCollectionAliases(String alias1, String alias2) throws com.broadleafcommerce.search.api.SearchIndexException Re-assigns the aliases to the other alias' respective collection. This method assumes that the provided aliases are already mapped to collections.- Parameters:
alias1
- The first alias to swapalias2
- The second alias to swap- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if an error occurs swapping the alias' collections
-
readAliases
Reads a map of alias name to Solr collection name.- Returns:
- a map containing all aliases mapped to their Solr collection name
- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if an error occurs reading the aliases
-
checkConnection
void checkConnection() throws com.broadleafcommerce.search.api.SearchIndexExceptionCheck that the provider can connect to Solr.- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if the connection to Solr failed
-
recreateAlias
The purpose of this is to empty, or delete and recreate, a collection.- Parameters:
alias
- The alias to empty by deleting and recreating- Throws:
com.broadleafcommerce.search.api.SearchIndexException
- if an error occurs recreating the alias
-