|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.search.CmsSearchManager
Implements the general management and configuration of the search and indexing facilities in OpenCms.
| Field Summary |
| Constructor Summary | |
CmsSearchManager()
Default constructer when called as cron job. |
|
| Method Summary | |
void |
addAnalyzer(CmsSearchAnalyzer analyzer)
Adds an analyzer. |
void |
addDocumentTypeConfig(CmsSearchDocumentType documentType)
Adds a document type. |
void |
addSearchIndex(CmsSearchIndex searchIndex)
Adds a search index configuration. |
void |
addSearchIndexSource(CmsSearchIndexSource searchIndexSource)
Adds a search index source configuration. |
void |
cmsEvent(CmsEvent event)
Implements the event listener of this class. |
protected Analyzer |
getAnalyzer(String locale)
Returns an analyzer for the given language. |
Map |
getAnalyzers()
Returns an unmodifiable view (read-only) of the Analyzers Map. |
CmsSearchAnalyzer |
getCmsSearchAnalyzer(String locale)
Returns the CmsSearchAnalyzer Object. |
String |
getDirectory()
Returns the name of the directory below WEB-INF/ where the search indexes are stored. |
protected I_CmsDocumentFactory |
getDocumentFactory(A_CmsIndexResource resource)
Returns a lucene document factory for given resource. |
CmsSearchDocumentType |
getDocumentTypeConfig(String name)
Returns a document type config. |
Map |
getDocumentTypeConfigs()
Returns an unmodifiable view (read-only) of the DocumentTypeConfigs Map. |
protected List |
getDocumentTypes()
Returns the set of names of all configured documenttypes. |
I_CmsTermHighlighter |
getHighlighter()
Returns the highlighter. |
CmsSearchIndex |
getIndex(String indexName)
Returns the index belonging to the passed name. |
List |
getIndexNames()
Returns the names of all configured indexes. |
CmsSearchIndexSource |
getIndexSource(String sourceName)
Returns a search index source for a specified source name. |
int |
getMaxExcerptLength()
Returns the max. |
protected Map |
getResultCache()
Returns the common cache for buffering search results. |
String |
getResultCacheSize()
Returns the result cache size. |
List |
getSearchIndexs()
Returns an unmodifiable list of all configured indexes. |
Map |
getSearchIndexSources()
Returns an unmodifiable view (read-only) of the SearchIndexSources Map. |
String |
getTimeout()
Returns the timeout to abandon threads indexing a resource. |
protected void |
initAvailableDocumentTypes()
Initializes the available Cms resource types to be indexed. |
void |
initialize(CmsObject cms)
Initializes the search manager. |
protected void |
initSearchIndexes()
Initializes the configured search indexes. |
String |
launch(CmsObject cms,
Map parameters)
Method for automatically rebuilding indexes configured with |
void |
setDirectory(String value)
Sets the name of the directory below WEB-INF/ where the search indexes are stored. |
void |
setHighlighter(String highlighter)
Sets the highlighter. |
void |
setMaxExcerptLength(String maxExcerptLength)
Sets the max. |
void |
setResultCacheSize(String value)
Sets the result cache size. |
void |
setTimeout(String value)
Sets the timeout to abandon threads indexing a resource. |
void |
updateIndex(I_CmsReport report)
Updates all configured indexes. |
void |
updateIndex(I_CmsReport report,
boolean wait)
Updates all configured indexes.. |
void |
updateIndex(String indexName)
Updates (if required creates) the index with the given name. |
void |
updateIndex(String indexName,
I_CmsReport report)
Updates (if required creates) the index with the given name. |
void |
updateIndex(String indexName,
I_CmsReport report,
boolean wait)
Updates (if required creates) the index with the given name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CmsSearchManager()
| Method Detail |
public void addAnalyzer(CmsSearchAnalyzer analyzer)
analyzer - an analyzerpublic void addDocumentTypeConfig(CmsSearchDocumentType documentType)
documentType - a document typepublic void addSearchIndex(CmsSearchIndex searchIndex)
searchIndex - a search index configurationpublic void addSearchIndexSource(CmsSearchIndexSource searchIndexSource)
searchIndexSource - a search index source configurationpublic void cmsEvent(CmsEvent event)
cmsEvent in interface I_CmsEventListenerevent - CmsEvent that has occurredI_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)public Map getAnalyzers()
public CmsSearchAnalyzer getCmsSearchAnalyzer(String locale)
locale - unique locale key to specify the CmsSearchAnalyzer in HashMap
public String getDirectory()
public CmsSearchDocumentType getDocumentTypeConfig(String name)
name - the name of the document type config
public Map getDocumentTypeConfigs()
public I_CmsTermHighlighter getHighlighter()
public CmsSearchIndex getIndex(String indexName)
The index must exist already.
indexName - then name of the index
public List getIndexNames()
public CmsSearchIndexSource getIndexSource(String sourceName)
sourceName - the name of the index source
public int getMaxExcerptLength()
public String getResultCacheSize()
public List getSearchIndexs()
public Map getSearchIndexSources()
public String getTimeout()
public void initialize(CmsObject cms)
cms - the cms object
public final String launch(CmsObject cms,
Map parameters)
throws Exception
launch in interface I_CmsScheduledJobcms - the cms objectparameters - the parameters for the scheduled job
Exception - if something goes wrongCmsScheduledJobInfo,
CmsScheduledJobInfo.setReuseInstance(boolean)public void setDirectory(String value)
value - the name of the directory below WEB-INF/ where the search indexes are storedpublic void setHighlighter(String highlighter)
A highlighter is a class implementing org.opencms.search.documents.I_TermHighlighter.
highlighter - the package/class name of the highlighterpublic void setMaxExcerptLength(String maxExcerptLength)
maxExcerptLength - the max. excerpt length to setpublic void setResultCacheSize(String value)
value - the result cache sizepublic void setTimeout(String value)
value - the timeout in milliseconds
public void updateIndex(I_CmsReport report)
throws CmsException
An index will be updated only if rebuild mode is set to auto.
report - the report object to write messages or null
CmsException - if something goes wrong
public void updateIndex(I_CmsReport report,
boolean wait)
throws CmsException
An index will be updated only if rebuild mode is set to auto.
report - the report object to write messages or nullwait - flag signals to wait until the indexing threads are finished
CmsException - if something goes wrong
public void updateIndex(String indexName)
throws CmsException
indexName - the name of the index to update
CmsException - if something goes wrong
public void updateIndex(String indexName,
I_CmsReport report)
throws CmsException
indexName - the name of the index to updatereport - the report object to write messages or null
CmsException - if something goes wrong
public void updateIndex(String indexName,
I_CmsReport report,
boolean wait)
throws CmsException
indexName - the name of the index to updatereport - the report object to write messages or nullwait - flag signals to wait until the indexing threads are finished or not
CmsException - is something goes wrong
protected Analyzer getAnalyzer(String locale)
throws CmsIndexException
The analyzer is selected according to the analyzer configuration.
locale - a language id, i.e. de, en, it
CmsIndexException - if something goes wrongprotected I_CmsDocumentFactory getDocumentFactory(A_CmsIndexResource resource)
The type of the document factory is selected by the type of the resource and the mimetype of the resource content according to the documenttype configuration.
resource - a cms resource
protected List getDocumentTypes()
protected Map getResultCache()
protected void initAvailableDocumentTypes()
A map stores document factories keyed by a string representing a colon separated list of Cms resource types and/or mimetypes.
The keys of this map are used to trigger a document factory to convert a Cms resource into a Lucene index document.
A document factory is a class implementing the interface
I_CmsDocumentFactory.
protected void initSearchIndexes()
This initializes also the list of Cms resources types to be indexed by an index source.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||