org.opencms.search
Interface I_CmsIndexer

All Known Implementing Classes:
CmsVfsIndexer

public interface I_CmsIndexer

Interface for an indexer indexing Cms resources.

Since:
6.0.0
Version:
$Revision: 1.17 $
Author:
Carsten Weinholz, Thomas Weckert

Method Summary
 void deleteResources(org.apache.lucene.index.IndexReader reader, java.util.List resourcesToDelete)
          Incremental index update - delete the index entry for all resources in the given list.
 CmsSearchIndexUpdateData getUpdateData(CmsSearchIndexSource source, java.util.List publishedResources)
          Calculates the data for an incremental search index update.
 I_CmsIndexer newInstance(CmsObject cms, I_CmsReport report, CmsSearchIndex index)
          Creates and initializes a new instance of this indexer implementation.
 void rebuildIndex(org.apache.lucene.index.IndexWriter writer, CmsIndexingThreadManager threadManager, CmsSearchIndexSource source)
          Rebuilds the index for the given configured index source.
 void updateResources(org.apache.lucene.index.IndexWriter writer, CmsIndexingThreadManager threadManager, java.util.List resourcesToUpdate)
          Incremental index update - create a new index entry for all resources in the given list.
 

Method Detail

deleteResources

public void deleteResources(org.apache.lucene.index.IndexReader reader,
                            java.util.List resourcesToDelete)
                     throws CmsIndexException
Incremental index update - delete the index entry for all resources in the given list.

Parameters:
reader - the index reader to delete the entries from
resourcesToDelete - a list of CmsPublishedResource instances that must be deleted
Throws:
CmsIndexException - if something goes wrong

getUpdateData

public CmsSearchIndexUpdateData getUpdateData(CmsSearchIndexSource source,
                                              java.util.List publishedResources)
                                       throws CmsIndexException
Calculates the data for an incremental search index update.

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
Throws:
CmsIndexException - if something goes wrong

newInstance

public I_CmsIndexer newInstance(CmsObject cms,
                                I_CmsReport report,
                                CmsSearchIndex index)
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 indexing
report - the report to write the indexing output to
index - the search index to update
Returns:
a new instance of this indexer implementation

rebuildIndex

public void rebuildIndex(org.apache.lucene.index.IndexWriter 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 to
source - the search index source to update
threadManager - the thread manager to use when extracting the document text
Throws:
CmsIndexException - if something goes wrong

updateResources

public void updateResources(org.apache.lucene.index.IndexWriter writer,
                            CmsIndexingThreadManager threadManager,
                            java.util.List 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 to
resourcesToUpdate - a list of CmsPublishedResource instances that must be updated
threadManager - the thread manager to use when extracting the document text
Throws:
CmsIndexException - if something goes wrong