Class SolrIndexer
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.content.indexing.solr.SolrIndexer
- All Implemented Interfaces:
- LogEnabled,- Initializable,- Component,- Contextualizable,- Serviceable
public class SolrIndexer
extends AbstractLogEnabled
implements Component, Serviceable, Initializable, Contextualizable
Solr indexer.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected StringThe Ametys internal URL used by Solr to query Ametysprotected ContextThe avalon contextprotected ReadAccessHelperThe helper for read accessprotected JackrabbitRepositoryThe JCR repositoryprotected AmetysObjectResolverThe ametys object resolver.protected SchemaDefinitionProviderExtensionPointThe schema definition provider extension point.protected SchemaHelperThe schema helper.protected SolrClientProviderThe Solr client providerprotected SolrContentIndexerSolr Ametys contents indexerprotected StringThe solr core prefix.protected SolrResourceIndexerSolr resource indexer.protected SolrWorkflowIndexerSolr workflow indexer.protected WorkspaceSelectorThe workspace selector.static final StringThe component role.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.apache.solr.client.solrj.SolrClient_getAutoCommitSolrClient(String workspaceName) Gets the 'autocommit' Solr clientprotected org.apache.solr.client.solrj.SolrClient_getNoAutoCommitSolrClient(String workspaceName) Gets the 'no autocommit' Solr clientprotected void_indexResourceDocument(Resource resource, org.apache.solr.common.SolrInputDocument document, org.apache.solr.client.solrj.SolrClient solrClient) Index a populated solr input document of type Resource.protected voidaddCustomUpdates(List<org.apache.solr.client.solrj.request.schema.SchemaRequest.Update> updates, SchemaFields schemaFields) Compute the list of customSchemaRequest.Updatedirectives.protected voidaddStaticSchemaUpdates(List<org.apache.solr.client.solrj.request.schema.SchemaRequest.Update> updates, org.apache.solr.client.solrj.response.schema.SchemaRepresentation staticSchema, SchemaFields schemaFields) Compute the list ofSchemaRequest.Updatedirectives from the static schema.protected voidclearSchema(org.apache.solr.client.solrj.SolrClient solrClient, String collection) Delete all the fields of the existing schema in the given collection.voidcommit()Process a Solr commit operation in all workspaces.voidProcess a Solr commit operation in given workspace.voidcontextualize(Context context) voidcreateCore(String name) Create a Solr core.static SimpleDateFormatDeprecated.voiddeleteCore(String name) Delete a Solr core.protected voiddeleteRepeaterDocs(String contentId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Delete repeater documents of a specified content.protected voiddoIndexContent(Content content, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Add or update a content into Solr indexprotected org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultdoIndexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Send some contents for indexation in the solr server.protected voiddoIndexContentWorkflow(Content content, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Index the whole workflow of a content.protected voiddoIndexExplorerItem(AmetysObject node, String documentType, TraversableAmetysObject resourceRoot, org.apache.solr.client.solrj.SolrClient solrClient) Add or update a resource into Solr indexprotected voiddoIndexResource(Resource resource, String documentType, TraversableAmetysObject resourceRoot, org.apache.solr.client.solrj.SolrClient solrClient) Add or update a resource into Solr indexprotected org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultdoIndexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Send some resources for indexation in the solr server.protected voiddoUnindexContentAttachments(String contentId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Delete content attachments documents of a given content from the Solr server.protected voiddoUnindexDocument(String id, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Delete a document from the Solr server.Get the names of the Solr cores.Get the names of the Solr cores.voidindexAclInitValues(AmetysObject ametysObject, org.apache.solr.common.SolrInputDocument document) Indexes read-ACl initial values for objectindexAllContents(String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) Index all the contents in a given workspace.indexAllContents(String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Index all the contents in a given workspace.indexAllResources(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Index all the resources in a given workspace.voidindexContent(String contentId, boolean indexAttachments) Add or update a content into Solr index on all workspaces and commitvoidindexContent(String contentId, String workspaceName, boolean indexAttachments) Add or update a content into Solr indexvoidindexContent(String contentId, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) Add or update a content into Solr indexvoidindexContentAttachment(Resource resource, Content content) Index a content attachmentvoidindexContentAttachment(Resource resource, Content content, org.apache.solr.client.solrj.SolrClient solrClient) Index a content attachmentvoidindexContentAttachments(ResourceCollection collection, Content content) Index content attachments as new entries in the idnexvoidindexContentAttachments(ResourceCollection collection, Content content, org.apache.solr.client.solrj.SolrClient solrClient) Index content attachments as new entries in the idnexorg.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexContents(Iterable<Content> contents) Send a collection of contents for indexation in the solr server on all workspaces and commitorg.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) Send a collection of contents for indexation in the solr server.org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Send a collection of contents for indexation in the solr server.org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexContents(Iterable<Content> contents, ContainerProgressionTracker progressionTracker) Send a collection of contents for indexation in the solr server on all workspaces and commitvoidindexResource(Resource resource, String documentType, String workspaceName) Add or update a resource into Solr indexorg.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Send a collection of contents for indexation in the solr server.org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) Send a collection of contents for indexation in the solr server.org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResultindexResources(Iterable<AmetysObject> resources, String documentType, String workspaceName) Send a collection of contents for indexation in the solr server.voidindexSubcontents(String collectionId, boolean indexAttachments) Add or update the child contents of aAmetysObjectCollectioninto Solr index, for all workspaces and commitvoidindexSubcontents(String collectionId, String workspaceName, boolean indexAttachments) Index the child contents of aAmetysObjectCollectionvoidvoidLaunch a solr index optimization.voidReloads the ACL Solr cache for all usersvoidreloadAclCache(String workspaceName) Reloads the ACL Solr cache for all usersvoidreloadAclCache(String workspaceName, boolean checkIfNecessary) Reloads the ACL Solr cache for all usersprotected voidReload the solr cores.voidSend the schema.voidservice(ServiceManager serviceManager) static StringtruncateUtf8StringValue(String value, Logger logger, String documentId, String fieldName) Truncates (if needed) the given string in order to be indexed without immense term error by Solr.protected voidunindexAllContents(String workspaceName, boolean unindexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) Unindex all content documents.voidunindexAllDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Delete all documents from the solr index.voidunindexContent(String contentId, boolean unindexAttachments) Remove a content from Solr index for all workspaces and commitvoidunindexContent(String contentId, String workspaceName, boolean unindexAttachments) Remove a content from Solr indexvoidunindexContent(String contentId, String workspaceName, boolean unindexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) Remove a content from Solr indexvoidunindexContents(Collection<String> contentIds) Remove a content from Solr index for all workspaces and commitvoidunindexContents(Collection<String> contentIds, String workspaceName) Remove a content from Solr indexvoidunindexResource(String resourceId) Remove a resource from Solr index for all workspaces and commitvoidunindexResource(String resourceId, String workspaceName) Remove a resource from the Solr index.voidunindexResourcesByPath(String rootId, String path) Delete all resource documents at a given path for all workspaces and commitvoidunindexResourcesByPath(String rootId, String path, String workspaceName) Delete all resource documents at a given path.voidupdateAclCache(Iterable<? extends AmetysObject> objects) Updates the ACL Solr cache for someAmetysObjects for all workspaces.voidupdateAclCache(Iterable<? extends AmetysObject> objects, String workspaceName) Updates the ACL Solr cache for someAmetysObjects.voidUpdates the ametys.url property of the Solr cores.voidupdateProperty(Content content, String propertyId, String workspaceName) Update the value of a specific property in a content document.voidupdateProperty(Content content, String propertyId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Update the value of a specific property in a content document.voidupdateSystemProperty(Content content, String propertyId, String workspaceName) Update the value of a specific system property in a content document.voidupdateSystemProperty(Content content, String propertyId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) Update the value of a specific system property in a content document.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabledgetLogger, setLogger
- 
Field Details- 
ROLEThe component role.
- 
_resolverThe ametys object resolver.
- 
_schemaDefProviderEPThe schema definition provider extension point.
- 
_schemaHelperThe schema helper.
- 
_solrContentIndexerSolr Ametys contents indexer
- 
_solrWorkflowIndexerSolr workflow indexer.
- 
_solrResourceIndexerSolr resource indexer.
- 
_solrClientProviderThe Solr client provider
- 
_solrCorePrefixThe solr core prefix.
- 
_ametysInternalUrlThe Ametys internal URL used by Solr to query Ametys
- 
_workspaceSelectorThe workspace selector.
- 
_repositoryThe JCR repository
- 
_readAccessHelperThe helper for read access
- 
_contextThe avalon context
 
- 
- 
Constructor Details- 
SolrIndexerpublic SolrIndexer()
 
- 
- 
Method Details- 
dateFormatDeprecated.useDateUtils.zonedDateTimeToString(java.time.ZonedDateTime, java.time.ZoneId)using UTC zone id insteadReturns the formatter for indexing dates. This is used for adding a dates as formatted strings (and not with date object directly) to prevent indexing of the wrong value because of time zone- Returns:
- The date format for indexing dates
 
- 
truncateUtf8StringValuepublic static String truncateUtf8StringValue(String value, Logger logger, String documentId, String fieldName) Truncates (if needed) the given string in order to be indexed without immense term error by Solr. Only the 32766 first bytes of the String will be kept.- Parameters:
- value- The string value to index
- logger- The logger for logging in WARN level in case the given string is too long and will be truncated. Can be null if you do not want to log.
- documentId- The id of the document being indexed. Can be null if you do not want to log.
- fieldName- The name of the field being indexed. Can be null if you do not want to log.
- Returns:
- The given string value, or its truncation if it is too long (greater than 32766 bytes)
 
- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
initialize- Specified by:
- initializein interface- Initializable
- Throws:
- Exception
 
- 
contextualize- Specified by:
- contextualizein interface- Contextualizable
- Throws:
- ContextException
 
- 
_getAutoCommitSolrClientGets the 'autocommit' Solr client- Parameters:
- workspaceName- The name of the workspace
- Returns:
- the Solr client
 
- 
_getNoAutoCommitSolrClientGets the 'no autocommit' Solr client- Parameters:
- workspaceName- The name of the workspace
- Returns:
- the Solr client
 
- 
getCoreNamespublic Set<String> getCoreNames() throws IOException, org.apache.solr.client.solrj.SolrServerExceptionGet the names of the Solr cores.- Returns:
- The names of the Solr cores.
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
getRealCoreNamesprotected Set<String> getRealCoreNames() throws IOException, org.apache.solr.client.solrj.SolrServerExceptionGet the names of the Solr cores.- Returns:
- The names of the Solr cores.
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
createCorepublic void createCore(String name) throws IOException, org.apache.solr.client.solrj.SolrServerException Create a Solr core.- Parameters:
- name- The name of the core to create.
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
updateAmetysUrlCorePropertyUpdates the ametys.url property of the Solr cores.
- 
deleteCorepublic void deleteCore(String name) throws IOException, org.apache.solr.client.solrj.SolrServerException Delete a Solr core.- Parameters:
- name- The name of the core to delete.
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
sendSchemaSend the schema.- Throws:
- IOException- If a communication error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a solr error occurs.
 
- 
addStaticSchemaUpdatesprotected void addStaticSchemaUpdates(List<org.apache.solr.client.solrj.request.schema.SchemaRequest.Update> updates, org.apache.solr.client.solrj.response.schema.SchemaRepresentation staticSchema, SchemaFields schemaFields) Compute the list ofSchemaRequest.Updatedirectives from the static schema.- Parameters:
- updates- The list of- SchemaRequest.Updatedirectives to fill.
- staticSchema- The static schema representation.
- schemaFields- The current schema fields, used to track the existing fields (to be filled).
 
- 
addCustomUpdatesprotected void addCustomUpdates(List<org.apache.solr.client.solrj.request.schema.SchemaRequest.Update> updates, SchemaFields schemaFields) Compute the list of customSchemaRequest.Updatedirectives.- Parameters:
- updates- The list of- SchemaRequest.Updatedirectives to fill.
- schemaFields- The current schema fields, used to track the existing fields (to be filled).
 
- 
clearSchemaprotected void clearSchema(org.apache.solr.client.solrj.SolrClient solrClient, String collection) throws IOException, org.apache.solr.client.solrj.SolrServerException Delete all the fields of the existing schema in the given collection.- Parameters:
- solrClient- The Solr client
- collection- The collection.
- Throws:
- IOException- If a communication error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a solr error occurs.
 
- 
reloadCoresReload the solr cores.- Throws:
- IOException- If a communication error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a solr error occurs.
 
- 
reloadAclCachepublic void reloadAclCache() throws IOException, org.apache.solr.client.solrj.SolrServerException, javax.jcr.RepositoryExceptionReloads the ACL Solr cache for all users- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
- javax.jcr.RepositoryException- If a repository exception occurs when retrieving workspaces.
 
- 
reloadAclCachepublic void reloadAclCache(String workspaceName) throws IOException, org.apache.solr.client.solrj.SolrServerException Reloads the ACL Solr cache for all users- Parameters:
- workspaceName- The workspace name
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
reloadAclCachepublic void reloadAclCache(String workspaceName, boolean checkIfNecessary) throws IOException, org.apache.solr.client.solrj.SolrServerException Reloads the ACL Solr cache for all users- Parameters:
- workspaceName- The workspace name
- checkIfNecessary- true to check if the reload is necessary for each segment (i.e. reload only the segments not already in cache)
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
 
- 
updateAclCachepublic void updateAclCache(Iterable<? extends AmetysObject> objects) throws IOException, org.apache.solr.client.solrj.SolrServerException, javax.jcr.RepositoryException Updates the ACL Solr cache for someAmetysObjects for all workspaces.- Parameters:
- objects- the- AmetysObjects to update.
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
- javax.jcr.RepositoryException- If a repository exception occurs when retrieving workspaces.
 
- 
updateAclCachepublic void updateAclCache(Iterable<? extends AmetysObject> objects, String workspaceName) throws IOException, org.apache.solr.client.solrj.SolrServerException, javax.jcr.RepositoryException Updates the ACL Solr cache for someAmetysObjects.- Parameters:
- objects- the- AmetysObjects to update.
- workspaceName- The workspace name
- Throws:
- IOException- If an I/O error occurs.
- org.apache.solr.client.solrj.SolrServerException- If a Solr error occurs.
- javax.jcr.RepositoryException- If a repository exception occurs when retrieving workspaces.
 
- 
indexAllContentspublic Map<String,Object> indexAllContents(String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Index all the contents in a given workspace.- Parameters:
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- Returns:
- The indexation result as a Map.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexAllContentspublic Map<String,Object> indexAllContents(String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Index all the contents in a given workspace.- Parameters:
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- The indexation result as a Map.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexAllContentsprotected void unindexAllContents(String workspaceName, boolean unindexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Unindex all content documents.- Parameters:
- workspaceName- The workspace name
- unindexAttachments- also unindex content attachments
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while unindexing.
 
- 
indexSubcontentsAdd or update the child contents of aAmetysObjectCollectioninto Solr index, for all workspaces and commit- Parameters:
- collectionId- The id of collection
- indexAttachments- to index content attachments
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexSubcontentspublic void indexSubcontents(String collectionId, String workspaceName, boolean indexAttachments) throws Exception Index the child contents of aAmetysObjectCollection- Parameters:
- collectionId- The id of collection
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- Throws:
- Exception- if an error occurs while unindexing.
 
- 
indexContentAdd or update a content into Solr index on all workspaces and commit- Parameters:
- contentId- The id of the content to index
- indexAttachments- to index content attachments
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentpublic void indexContent(String contentId, String workspaceName, boolean indexAttachments) throws Exception Add or update a content into Solr index- Parameters:
- contentId- The id of the content to index
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentpublic void indexContent(String contentId, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Add or update a content into Solr index- Parameters:
- contentId- The id of the content to index
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentspublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexContents(Iterable<Content> contents) throws Exception Send a collection of contents for indexation in the solr server on all workspaces and commit- Parameters:
- contents- the collection of contents to index.
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentspublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexContents(Iterable<Content> contents, ContainerProgressionTracker progressionTracker) throws Exception Send a collection of contents for indexation in the solr server on all workspaces and commit- Parameters:
- contents- the collection of contents to index.
- progressionTracker- The progression of the indexation
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentspublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Send a collection of contents for indexation in the solr server.- Parameters:
- contents- the collection of contents to index.
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentspublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Send a collection of contents for indexation in the solr server.- Parameters:
- contents- the collection of contents to index.
- workspaceName- the workspace where to index
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
doIndexContentsprotected org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult doIndexContents(Iterable<Content> contents, String workspaceName, boolean indexAttachments, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Send some contents for indexation in the solr server.- Parameters:
- contents- the contents to index.
- workspaceName- The workspace name
- indexAttachments- to index content attachments
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs committing the results.
 
- 
updateSystemPropertypublic void updateSystemProperty(Content content, String propertyId, String workspaceName) throws Exception Update the value of a specific system property in a content document.- Parameters:
- content- The content to update.
- propertyId- The system property ID.
- workspaceName- The workspace name
- Throws:
- Exception- if an error occurs while indexing.
 
- 
updateSystemPropertypublic void updateSystemProperty(Content content, String propertyId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Update the value of a specific system property in a content document.- Parameters:
- content- The content to update.
- propertyId- The system property ID.
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
updatePropertypublic void updateProperty(Content content, String propertyId, String workspaceName) throws Exception Update the value of a specific property in a content document.- Parameters:
- content- The content to update.
- propertyId- The system property ID.
- workspaceName- The workspace name
- Throws:
- Exception- if an error occurs while indexing.
 
- 
updatePropertypublic void updateProperty(Content content, String propertyId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Update the value of a specific property in a content document.- Parameters:
- content- The content to update.
- propertyId- The system property ID.
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexContentRemove a content from Solr index for all workspaces and commit- Parameters:
- contentId- The id of content to unindex
- unindexAttachments- also unindex content attachments
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexContentpublic void unindexContent(String contentId, String workspaceName, boolean unindexAttachments) throws Exception Remove a content from Solr index- Parameters:
- contentId- The id of content to unindex
- workspaceName- The workspace where to work in
- unindexAttachments- also unindex content attachments
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexContentpublic void unindexContent(String contentId, String workspaceName, boolean unindexAttachments, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Remove a content from Solr index- Parameters:
- contentId- The id of content to unindex
- workspaceName- The workspace where to work in
- unindexAttachments- also unindex content attachments
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexContentsRemove a content from Solr index for all workspaces and commit- Parameters:
- contentIds- The id of content to unindex
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexContentsRemove a content from Solr index- Parameters:
- contentIds- The id of content to unindex
- workspaceName- The workspace where to work in
- Throws:
- Exception- if an error occurs while indexing.
 
- 
doIndexContentprotected void doIndexContent(Content content, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Add or update a content into Solr index- Parameters:
- content- The content to index
- workspaceName- The workspace where to index
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexAclInitValuespublic void indexAclInitValues(AmetysObject ametysObject, org.apache.solr.common.SolrInputDocument document) Indexes read-ACl initial values for object- Parameters:
- ametysObject- The object
- document- The Solr document
 
- 
doIndexContentWorkflowprotected void doIndexContentWorkflow(Content content, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Index the whole workflow of a content.- Parameters:
- content- The content.
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexContentAttachmentspublic void indexContentAttachments(ResourceCollection collection, Content content) throws Exception Index content attachments as new entries in the idnex- Parameters:
- collection- the collection of attachments
- content- the content whose attachments will be indexed
- Throws:
- Exception- if something goes wrong when indexing the attachments of the content
 
- 
indexContentAttachmentspublic void indexContentAttachments(ResourceCollection collection, Content content, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Index content attachments as new entries in the idnex- Parameters:
- collection- the collection of attachments
- content- the content whose attachments will be indexed
- solrClient- The solr client to use
- Throws:
- Exception- if something goes wrong when indexing the attachments of the content
 
- 
indexContentAttachmentIndex a content attachment
- 
indexContentAttachmentpublic void indexContentAttachment(Resource resource, Content content, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Index a content attachment
- 
_indexResourceDocumentprotected void _indexResourceDocument(Resource resource, org.apache.solr.common.SolrInputDocument document, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException Index a populated solr input document of type Resource.- Parameters:
- resource- the resource from which the input document is created
- document- the input document
- solrClient- The solr client to use
- Throws:
- org.apache.solr.client.solrj.SolrServerException- if there is an error on the server
- IOException- if there is a communication error with the server
 
- 
deleteRepeaterDocsprotected void deleteRepeaterDocs(String contentId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Delete repeater documents of a specified content.- Parameters:
- workspaceName- The workspace name
- contentId- the content ID.
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexAllResourcespublic Map<String,Object> indexAllResources(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Index all the resources in a given workspace.- Parameters:
- workspaceName- The workspace where to index
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- The indexation result as a Map.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexResourcespublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexResources(Iterable<AmetysObject> resources, String documentType, String workspaceName) throws Exception Send a collection of contents for indexation in the solr server.- Parameters:
- resources- the collection of contents to index.
- documentType- The document type of the resource
- workspaceName- The workspace where to index
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexResourcespublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Send a collection of contents for indexation in the solr server.- Parameters:
- resources- the collection of contents to index.
- documentType- The document type of the resource
- resourceRoot- The resource root, can be null. In that case, it will be computed for each resource.
- workspaceName- The workspace where to index
- solrClient- The solr client to use
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
indexResourcespublic org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult indexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Send a collection of contents for indexation in the solr server.- Parameters:
- resources- the collection of contents to index.
- documentType- The document type of the resource
- resourceRoot- The resource root, can be null. In that case, it will be computed for each resource.
- workspaceName- The workspace where to index
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs while indexing.
 
- 
doIndexResourcesprotected org.ametys.cms.content.indexing.solr.SolrIndexer.IndexationResult doIndexResources(Iterable<? extends AmetysObject> resources, String documentType, TraversableAmetysObject resourceRoot, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient, SimpleProgressionTracker progressionTracker) throws Exception Send some resources for indexation in the solr server.- Parameters:
- resources- the resources to index.
- documentType- The document type of the resource
- resourceRoot- The resource root, can be null. In that case, it will be computed for each resource.
- workspaceName- The workspace where to index
- solrClient- The solr client to use
- progressionTracker- The progression of the indexation
- Returns:
- the indexation result.
- Throws:
- Exception- if an error occurs committing the results.
 
- 
indexResourcepublic void indexResource(Resource resource, String documentType, String workspaceName) throws Exception Add or update a resource into Solr index- Parameters:
- resource- The resource to index
- documentType- The document type of the resource
- workspaceName- The workspace where to index
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexResourcesByPathDelete all resource documents at a given path for all workspaces and commit- Parameters:
- rootId- The resource root ID, must not be null.
- path- The resource path relative to the given root, must start with a slash.
- Throws:
- Exception- If an error occurs while unindexing.
 
- 
unindexResourcesByPathpublic void unindexResourcesByPath(String rootId, String path, String workspaceName) throws Exception Delete all resource documents at a given path.- Parameters:
- rootId- The resource root ID, must not be null.
- path- The resource path relative to the given root, must start with a slash.
- workspaceName- The workspace where to work in
- Throws:
- Exception- If an error occurs while unindexing.
 
- 
unindexResourceRemove a resource from Solr index for all workspaces and commit- Parameters:
- resourceId- The id of resource to unindex
- Throws:
- Exception- if an error occurs while indexing.
 
- 
unindexResourceRemove a resource from the Solr index.- Parameters:
- resourceId- The id of resource to unindex
- workspaceName- The workspace where to work in
- Throws:
- Exception- if an error occurs while unindexing.
 
- 
doIndexExplorerItemprotected void doIndexExplorerItem(AmetysObject node, String documentType, TraversableAmetysObject resourceRoot, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Add or update a resource into Solr index- Parameters:
- node- The resource to index
- documentType- The document type of the resource
- resourceRoot- The resource root, can be null. In that case, it will be computed for each resource.
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
doIndexResourceprotected void doIndexResource(Resource resource, String documentType, TraversableAmetysObject resourceRoot, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Add or update a resource into Solr index- Parameters:
- resource- The resource to index
- documentType- The document type of the resource
- resourceRoot- The resource root, can be null. In that case, it will be computed for each resource.
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
commitProcess a Solr commit operation in all workspaces.
 Use this only after a long operation with updates sent viaNoAutoCommitUpdateClient- Throws:
- org.apache.solr.client.solrj.SolrServerException- if there is an error on the server
- IOException- if there is a communication error with the server
 
- 
commitpublic void commit(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException Process a Solr commit operation in given workspace.- Parameters:
- workspaceName- The workspace's name
- solrClient- The solr client to use
- Throws:
- org.apache.solr.client.solrj.SolrServerException- if there is an error on the server
- IOException- if there is a communication error with the server
 
- 
optimizepublic void optimize(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws org.apache.solr.client.solrj.SolrServerException, IOException Launch a solr index optimization.- Parameters:
- workspaceName- The workspace's name
- solrClient- The solr client to use
- Throws:
- org.apache.solr.client.solrj.SolrServerException- if there is an error on the server
- IOException- if there is a communication error with the server
 
- 
unindexAllDocumentspublic void unindexAllDocuments(String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Delete all documents from the solr index.- Parameters:
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while unindexing.
 
- 
doUnindexDocumentprotected void doUnindexDocument(String id, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Delete a document from the Solr server.- Parameters:
- id- The id of the document to delete from Solr
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
- 
doUnindexContentAttachmentsprotected void doUnindexContentAttachments(String contentId, String workspaceName, org.apache.solr.client.solrj.SolrClient solrClient) throws Exception Delete content attachments documents of a given content from the Solr server.- Parameters:
- contentId- The id of the content
- workspaceName- The workspace name
- solrClient- The solr client to use
- Throws:
- Exception- if an error occurs while indexing.
 
 
- 
DateUtils.zonedDateTimeToString(java.time.ZonedDateTime, java.time.ZoneId)using UTC zone id instead