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.12 $
Author:
Carsten Weinholz, Thomas Weckert

Method Summary
 A_CmsIndexResource getIndexResource(CmsObject cms, Document doc)
          Returns an index resource for a specified Lucene search result document.
 void init(I_CmsReport report, CmsSearchIndex index, CmsSearchIndexSource indexSource, IndexWriter writer, CmsIndexingThreadManager threadManager)
          Initializes the indexer.
 void updateIndex(CmsObject cms, String source, String path)
          Creates new index entries for all resources below the given path.
 

Method Detail

init

public void init(I_CmsReport report,
                 CmsSearchIndex index,
                 CmsSearchIndexSource indexSource,
                 IndexWriter writer,
                 CmsIndexingThreadManager threadManager)
          throws CmsIndexException
Initializes the indexer.

Parameters:
report - the report
index - the search index
indexSource - the search index source
writer - writer to write the search index in the physical file system
threadManager - the tread manager
Throws:
CmsIndexException - if something goes wrong

updateIndex

public void updateIndex(CmsObject cms,
                        String source,
                        String path)
                 throws CmsIndexException
Creates new index entries for all resources below the given path.

Parameters:
cms - the current user's CmsObject
source - the source of the resources
path - the path to the root of the subtree to index
Throws:
CmsIndexException - if something goes wrong

getIndexResource

public A_CmsIndexResource getIndexResource(CmsObject cms,
                                           Document doc)
                                    throws CmsException
Returns an index resource for a specified Lucene search result document.

Implementations of this method have to check if the current user has read permissions on the Cms resource represented by the Lucene document.

If this check fails, the implementation must return null as a result.

Parameters:
cms - the current user's CmsObject
doc - the Lucene search result document
Returns:
a new index resource
Throws:
CmsException - if something goes wrong
See Also:
A_CmsIndexResource