<< Back - Alkacon logo

OpenCms 6.0 interactive documentation:

Search Configuration: Overview

OpenCms logo - Forward >>

Search configuration overview

The search configuration is done in WEB-INF/config/opencms-search.xml. The configuration is specified in the following XML format:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE opencms SYSTEM "http://www.opencms.org/dtd/6.0/opencms-search.dtd">

<opencms>
	<search>
		<cache>8</cache>
		<directory>index</directory>
		<timeout>60000</timeout>
		<excerpt>1024</excerpt>
		<highlighter>org.opencms.search.documents.CmsHtmlHighlighter</highlighter>		
		<documenttypes>		
		...
		</documenttypes>
		<analyzers>
		...
		</analyzers>
		<indexes>
		...
		</indexes>
		<indexsources>				
		...
		</indexsources>		
	</search>
</opencms>

Configuration nodes

Within the <search> node, these sub-nodes must be declared:

  • the <cache> node specifies the total number of cached search results
  • the <directory> node specifies the directory below the WEB-INF/ directory within the OpenCms web application where Lucene stores its index files
  • the <timeout> node specifies the timeout value used to abort the indexing thread of a single resource
  • the <excerpt> node specifies the maximum character length of the excerpt in the search results
  • the <highlighter> node specifies a class implementing org.opencms.search.documents.I_TermHighlighter to highlight the search terms in the excerpt.
  • the <documenttypes> node has one or more <documenttype> sub-nodes that specify which Cms resource types and/or mimetypes are maped to a Lucene document factory
  • the <analyzers> node has one or more sub-nodes to specify the Lucene or snowball analyzer to be used for a certain locale
  • the <indexes> node has one or more sub-nodes to specify search indexes

Example

For examples, see the next pages explaining the configuration of the various nodes. For a complete example, look into the default search configuration located at WEB-INF/config/opencms-search.xml in the OpenCms web application.

©2003-2005 Alkacon Software (http://www.alkacon.com) - The OpenCms experts