Package org.ametys.cms.indexing.solr
Class SolrWorkspaceIndexer
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.indexing.solr.SolrWorkspaceIndexer
- All Implemented Interfaces:
WorkspaceIndexer,LogEnabled,Component,Contextualizable,Serviceable
- Direct Known Subclasses:
SolrWebWorkspaceIndexer
public class SolrWorkspaceIndexer
extends AbstractLogEnabled
implements WorkspaceIndexer, Component, Serviceable, Contextualizable
Component indexing a workspace in a Solr server.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe component context.protected DocumentProviderExtensionPointAdditional documents provider extension point.protected javax.jcr.RepositoryThe repository.protected SolrClientProviderThe Solr client providerprotected SolrIndexerThe solr indexer.protected WorkspaceSelectorThe workspace selector.Fields inherited from interface org.ametys.cms.indexing.WorkspaceIndexer
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) protected voidIndex the given workspace.protected voidensureCoreExists(String coreName) Create the given core if it doesn't exist.protected voidensureCoresExists(String[] coreNames) Create the given cores if they do not exist.voidIndex a workspace.protected voidindexAdditionalDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Index additional documents provided by the extensions.voidIndex all the workspaces.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_repository
The repository. -
_solrIndexer
The solr indexer. -
_workspaceSelector
The workspace selector. -
_docProviderEP
Additional documents provider extension point. -
_solrClientProvider
The Solr client provider -
_context
The component context.
-
-
Constructor Details
-
SolrWorkspaceIndexer
public SolrWorkspaceIndexer()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
indexAllWorkspaces
Description copied from interface:WorkspaceIndexerIndex all the workspaces.- Specified by:
indexAllWorkspacesin interfaceWorkspaceIndexer- Throws:
IndexingException- If an error occurs while indexing.
-
index
Description copied from interface:WorkspaceIndexerIndex a workspace.- Specified by:
indexin interfaceWorkspaceIndexer- Parameters:
workspaceName- The workspace name.- Throws:
IndexingException- If an error occurs while indexing the workspace.
-
doIndex
Index the given workspace.- Parameters:
workspaceName- The workspace name.- Throws:
IndexingException- If an error occurs indexing the workspace.
-
indexAdditionalDocuments
protected void indexAdditionalDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws IndexingException Index additional documents provided by the extensions.- Parameters:
workspaceName- The workspace name.solrClient- The solr client to use- Throws:
IndexingException- If an error occurs while indexing.
-
ensureCoresExists
Create the given cores if they do not exist.- Parameters:
coreNames- The core names.- Throws:
IndexingException- If an error occurs while checking if cores exist.
-
ensureCoreExists
Create the given core if it doesn't exist.- Parameters:
coreName- The core name.- Throws:
IndexingException- If an error occurs while checking if core exists.
-