Configuration

From OpenCms Wiki
Revision as of 21:46, 5 August 2008 by Thowland (Talk | contribs)
Jump to: navigation, search

OpenCms comes with a built in search index for the online and offline projects. Additional search indices can be created but have to be done through editing the XML config file opencms-search.xml.

Make a backup before touching these config files!!! OpenCms will not even run if there is a problem in them.

A additional search index section would go in the indexes section of opencms-search.xml, and would look something like this:

 <index>
    <name>myproject</name>
    <rebuild>auto</rebuild>
    <project>Online</project>
    <locale>en</locale>
    <sources>
        <source>source1</source>
    </sources>
 </index>

You also need to create an index source to go along with it, it goes in the indexsources section of the XML:

 <indexsource>
    <name>source1</name>
    <indexer class="org.opencms.search.CmsVfsIndexer"/>
    <resources>
         <resource>/sites/mysite/</resource>
    </resources>
    <documenttypes-indexed>
         <name>xmlpage</name>
         <name>xmlcontent</name>
         <name>text</name>
         <name>pdf</name>
         <name>rtf</name>
         <name>html</name>
         <name>msword</name>
         <name>msexcel</name>
         <name>mspowerpoint</name>
         <name>image</name>
         <name>generic</name>
    </documenttypes-indexed>
 </indexsource>

And if you want any custom document type, you'll have to add that to the documenttypes section. You may also have to create a CmsDocumentClass in Java for it, or find one it can share. See Custom_File_and_Folder_Types for more information on how to create a custom document type. Here is an existing sample:

 <documenttype>
     <name>rtf</name>
     <class>org.opencms.search.documents.CmsDocumentRtf</class>
     <mimetypes>
          <mimetype>text/rtf</mimetype>
          <mimetype>application/rtf</mimetype>
     </mimetypes>
     <resourcetypes>
          <resourcetype>binary</resourcetype>
          <resourcetype>plain</resourcetype>
     </resourcetypes>
 </documenttype>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox