Package org.opencms.search
Interface I_CmsIndexer
- All Known Implementing Classes:
CmsDependencyIndexer,CmsVfsIndexer
public interface I_CmsIndexer
Indexes resources for the OpenCms search.
This is a high level interface that abstracts the index generation process from the search index itself. Implement this in case special handling of the index generation process is required.
- Since:
- 6.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteResources(I_CmsIndexWriter indexWriter, List<CmsPublishedResource> resourcesToDelete) Incremental index update - delete the index entry for all resources in the given list.getUpdateData(CmsSearchIndexSource source, List<CmsPublishedResource> publishedResources) Calculates the data for an incremental search index update.booleanReturnstrueif this VFS indexer is able to resolve locale dependencies between documents.newInstance(CmsObject cms, I_CmsReport report, I_CmsSearchIndex index) Creates and initializes a new instance of this indexer implementation.voidrebuildIndex(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsSearchIndexSource source) Rebuilds the index for the given configured index source.voidupdateResources(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, List<CmsPublishedResource> resourcesToUpdate) Incremental index update - create a new index entry for all resources in the given list.
-
Method Details
-
deleteResources
void deleteResources(I_CmsIndexWriter indexWriter, List<CmsPublishedResource> resourcesToDelete) throws CmsIndexException Incremental index update - delete the index entry for all resources in the given list.- Parameters:
indexWriter- the writer to the index to delete the entries fromresourcesToDelete- a list ofinstances that must be deletedCmsPublishedResource- Throws:
CmsIndexException- if something goes wrong
-
getUpdateData
CmsSearchIndexUpdateData getUpdateData(CmsSearchIndexSource source, List<CmsPublishedResource> publishedResources) throws CmsIndexException Calculates the data for an incremental search index update.- Parameters:
source- the search index source to updatepublishedResources- a list ofobjects that are to be updatedCmsPublishedResource- Returns:
- a container with the information about the resources to delete and / or update
- Throws:
CmsIndexException- if something goes wrong
-
isLocaleDependenciesEnable
boolean isLocaleDependenciesEnable()Returnstrueif this VFS indexer is able to resolve locale dependencies between documents.- Returns:
trueif this VFS indexer is able to resolve locale dependencies between documents
-
newInstance
Creates and initializes a new instance of this indexer implementation.- Parameters:
cms- the OpenCms user context to use when reading resources from the VFS during indexingreport- the report to write the indexing output toindex- the search index to update- Returns:
- a new instance of this indexer implementation
-
rebuildIndex
void rebuildIndex(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsSearchIndexSource source) throws CmsIndexException Rebuilds the index for the given configured index source.This is used when the index is fully rebuild, not for updating only some parts of an existing index.
- Parameters:
writer- the index writer to write the update tothreadManager- the thread manager to use when extracting the document textsource- the search index source to update- Throws:
CmsIndexException- if something goes wrong
-
updateResources
void updateResources(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, List<CmsPublishedResource> resourcesToUpdate) throws CmsIndexException Incremental index update - create a new index entry for all resources in the given list.- Parameters:
writer- the index writer to write the update tothreadManager- the thread manager to use when extracting the document textresourcesToUpdate- a list ofinstances that must be updatedCmsPublishedResource- Throws:
CmsIndexException- if something goes wrong
-