org.opencms.search
Class CmsDependencyIndexer

java.lang.Object
  extended by org.opencms.search.CmsVfsIndexer
      extended by org.opencms.search.CmsDependencyIndexer
All Implemented Interfaces:
I_CmsIndexer

public class CmsDependencyIndexer
extends CmsVfsIndexer

A VFS indexer that resolves locale dependent documents.

Since:
8.5.0

Field Summary
 
Fields inherited from class org.opencms.search.CmsVfsIndexer
m_cms, m_index, m_report
 
Constructor Summary
CmsDependencyIndexer()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.util.List<CmsResource>> createFolderLookupMap(java.util.List<CmsResource> resources)
          Creates a folder based lookup map for the given resource list.
 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.
 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.
 
Methods inherited from class org.opencms.search.CmsVfsIndexer
addResourceToUpdateData, deleteResource, deleteResources, getCms, getIndex, getReport, isResourceInTimeWindow, updateResource, updateResource, updateResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsDependencyIndexer

public CmsDependencyIndexer()
Method Detail

getUpdateData

public CmsSearchIndexUpdateData getUpdateData(CmsSearchIndexSource source,
                                              java.util.List<CmsPublishedResource> publishedResources)
Description copied from interface: I_CmsIndexer
Calculates the data for an incremental search index update.

Specified by:
getUpdateData in interface I_CmsIndexer
Overrides:
getUpdateData in class CmsVfsIndexer
Parameters:
source - the search index source to update
publishedResources - a list of CmsPublishedResource objects that are to be updated
Returns:
a container with the information about the resources to delete and / or update
See Also:
CmsVfsIndexer.getUpdateData(org.opencms.search.CmsSearchIndexSource, java.util.List)

isLocaleDependenciesEnable

public boolean isLocaleDependenciesEnable()
Description copied from class: CmsVfsIndexer
The default indexer is not able to resolve locale dependencies between documents.

Specified by:
isLocaleDependenciesEnable in interface I_CmsIndexer
Overrides:
isLocaleDependenciesEnable in class CmsVfsIndexer
Returns:
true if this VFS indexer is able to resolve locale dependencies between documents
See Also:
CmsVfsIndexer.isLocaleDependenciesEnable()

newInstance

public I_CmsIndexer newInstance(CmsObject cms,
                                I_CmsReport report,
                                CmsSearchIndex index)
Description copied from interface: I_CmsIndexer
Creates and initializes a new instance of this indexer implementation.

Specified by:
newInstance in interface I_CmsIndexer
Overrides:
newInstance in class CmsVfsIndexer
Parameters:
cms - the OpenCms user context to use when reading resources from the VFS during indexing
report - the report to write the indexing output to
index - the search index to update
Returns:
a new instance of this indexer implementation
See Also:
CmsVfsIndexer.newInstance(org.opencms.file.CmsObject, org.opencms.report.I_CmsReport, org.opencms.search.CmsSearchIndex)

rebuildIndex

public void rebuildIndex(I_CmsIndexWriter writer,
                         CmsIndexingThreadManager threadManager,
                         CmsSearchIndexSource source)
                  throws CmsIndexException
Description copied from interface: I_CmsIndexer
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.

Specified by:
rebuildIndex in interface I_CmsIndexer
Overrides:
rebuildIndex in class CmsVfsIndexer
Parameters:
writer - the index writer to write the update to
threadManager - the thread manager to use when extracting the document text
source - the search index source to update
Throws:
CmsIndexException - if something goes wrong
See Also:
I_CmsIndexer.rebuildIndex(org.opencms.search.I_CmsIndexWriter, org.opencms.search.CmsIndexingThreadManager, org.opencms.search.CmsSearchIndexSource)

createFolderLookupMap

protected java.util.Map<java.lang.String,java.util.List<CmsResource>> createFolderLookupMap(java.util.List<CmsResource> resources)
Creates a folder based lookup map for the given resource list.

Parameters:
resources - the list of resource to build the lookup map for
Returns:
a folder based lookup map for the given resource list