public class CmsVfsIndexer extends java.lang.Object implements I_CmsIndexer
CmsResource based content from the OpenCms VFS.| 限定符和类型 | 字段和说明 |
|---|---|
protected CmsObject |
m_cms
The OpenCms user context to use when reading resources from the VFS during indexing.
|
protected CmsSearchIndex |
m_index
The index.
|
protected I_CmsReport |
m_report
The report.
|
| 构造器和说明 |
|---|
CmsVfsIndexer() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addResourceToUpdateData(CmsPublishedResource pubRes,
CmsSearchIndexUpdateData updateData)
Adds a given published resource to the provided search index update data.
|
protected void |
deleteResource(I_CmsIndexWriter indexWriter,
CmsPublishedResource resource)
Deletes a resource with the given index writer.
|
void |
deleteResources(I_CmsIndexWriter indexWriter,
java.util.List<CmsPublishedResource> resourcesToDelete)
Incremental index update - delete the index entry for all resources in the given list.
|
CmsObject |
getCms()
Returns the OpenCms user context used by this indexer.
|
CmsSearchIndex |
getIndex()
Returns the OpenCms search index updated by this indexer.
|
I_CmsReport |
getReport()
Returns the report used by this indexer.
|
CmsSearchIndexUpdateData |
getUpdateData(CmsSearchIndexSource source,
java.util.List<CmsPublishedResource> publishedResources)
Calculates the data for an incremental search index update.
|
boolean |
isLocaleDependenciesEnable()
The default indexer is not able to resolve locale dependencies between documents.
|
protected boolean |
isResourceInTimeWindow(CmsPublishedResource resource)
Checks if the published resource is inside the time window set with release and expiration date.
|
I_CmsIndexer |
newInstance(CmsObject cms,
I_CmsReport report,
CmsSearchIndex index)
Creates and initializes a new instance of this indexer implementation.
|
void |
rebuildIndex(I_CmsIndexWriter writer,
CmsIndexingThreadManager threadManager,
CmsSearchIndexSource source)
Rebuilds the index for the given configured index source.
|
protected void |
updateResource(I_CmsIndexWriter writer,
CmsIndexingThreadManager threadManager,
CmsResource resource)
Updates (writes) a single resource in the index.
|
protected void |
updateResource(I_CmsIndexWriter indexWriter,
java.lang.String rootPath,
I_CmsSearchDocument doc)
Updates a resource with the given index writer and the new document provided.
|
void |
updateResources(I_CmsIndexWriter writer,
CmsIndexingThreadManager threadManager,
java.util.List<CmsPublishedResource> resourcesToUpdate)
Incremental index update - create a new index entry for all resources in the given list.
|
protected CmsObject m_cms
protected CmsSearchIndex m_index
protected I_CmsReport m_report
public void deleteResources(I_CmsIndexWriter indexWriter, java.util.List<CmsPublishedResource> resourcesToDelete)
I_CmsIndexerdeleteResources 在接口中 I_CmsIndexerindexWriter - the writer to the index to delete the entries fromresourcesToDelete - a list of CmsPublishedResource instances that must be deletedI_CmsIndexer.deleteResources(org.opencms.search.I_CmsIndexWriter, java.util.List)public CmsObject getCms()
public CmsSearchIndex getIndex()
public I_CmsReport getReport()
public CmsSearchIndexUpdateData getUpdateData(CmsSearchIndexSource source, java.util.List<CmsPublishedResource> publishedResources)
I_CmsIndexergetUpdateData 在接口中 I_CmsIndexersource - the search index source to updatepublishedResources - a list of CmsPublishedResource objects that are to be updatedI_CmsIndexer.getUpdateData(org.opencms.search.CmsSearchIndexSource, java.util.List)public boolean isLocaleDependenciesEnable()
isLocaleDependenciesEnable 在接口中 I_CmsIndexertrue if this VFS indexer is able to resolve locale dependencies between documentsI_CmsIndexer.isLocaleDependenciesEnable()public I_CmsIndexer newInstance(CmsObject cms, I_CmsReport report, CmsSearchIndex index)
I_CmsIndexernewInstance 在接口中 I_CmsIndexercms - 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 updateI_CmsIndexer.newInstance(org.opencms.file.CmsObject, org.opencms.report.I_CmsReport, org.opencms.search.CmsSearchIndex)public void rebuildIndex(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsSearchIndexSource source) throws CmsIndexException
I_CmsIndexerThis is used when the index is fully rebuild, not for updating only some parts of an existing index.
rebuildIndex 在接口中 I_CmsIndexerwriter - the index writer to write the update tothreadManager - the thread manager to use when extracting the document textsource - the search index source to updateCmsIndexException - if something goes wrongI_CmsIndexer.rebuildIndex(org.opencms.search.I_CmsIndexWriter, org.opencms.search.CmsIndexingThreadManager, org.opencms.search.CmsSearchIndexSource)public void updateResources(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, java.util.List<CmsPublishedResource> resourcesToUpdate) throws CmsIndexException
I_CmsIndexerupdateResources 在接口中 I_CmsIndexerwriter - the index writer to write the update tothreadManager - the thread manager to use when extracting the document textresourcesToUpdate - a list of CmsPublishedResource instances that must be updatedCmsIndexException - if something goes wrongI_CmsIndexer.updateResources(org.opencms.search.I_CmsIndexWriter, org.opencms.search.CmsIndexingThreadManager, java.util.List)protected void addResourceToUpdateData(CmsPublishedResource pubRes, CmsSearchIndexUpdateData updateData)
This method decides if the resource has to be included in the "update" or "delete" list.
pubRes - the published resource to addupdateData - the search index update data to add the resource toprotected void deleteResource(I_CmsIndexWriter indexWriter, CmsPublishedResource resource)
indexWriter - the index writer to resource the resource withresource - the root path of the resource to deleteprotected boolean isResourceInTimeWindow(CmsPublishedResource resource)
resource - the published resource to checkprotected void updateResource(I_CmsIndexWriter writer, CmsIndexingThreadManager threadManager, CmsResource resource) throws CmsIndexException
writer - the index writer to usethreadManager - the thread manager to use when extracting the document textresource - the resource to updateCmsIndexException - if something goes wrongprotected void updateResource(I_CmsIndexWriter indexWriter, java.lang.String rootPath, I_CmsSearchDocument doc)
indexWriter - the index writer to update the resource withrootPath - the root path of the resource to updatedoc - the new document for the resource