Configuration

(Difference between revisions)
Jump to: navigation, search
m
(fixed xml formatting issue)
Line 4: Line 4:
  
 
A additional search index section would go in the indexes section of opencms-search.xml, and would look something like this:
 
A additional search index section would go in the indexes section of opencms-search.xml, and would look something like this:
 
+
<code lang="xml">
 
  <index>
 
  <index>
 
     <name>myproject</name>
 
     <name>myproject</name>
Line 14: Line 14:
 
     </sources>
 
     </sources>
 
  </index>
 
  </index>
 
+
</code>
 
You also need to create an index source to go along with it, it goes in the indexsources section of the XML:
 
You also need to create an index source to go along with it, it goes in the indexsources section of the XML:
 
+
<code lang="xml">
 
  <indexsource>
 
  <indexsource>
 
     <name>source1</name>
 
     <name>source1</name>
Line 37: Line 37:
 
     </documenttypes-indexed>
 
     </documenttypes-indexed>
 
  </indexsource>
 
  </indexsource>
 
+
</code>
 
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:
 
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:
 +
<code lang="xml">
 
  <documenttype>
 
  <documenttype>
 
     <name>rtf</name>
 
     <name>rtf</name>
Line 51: Line 52:
 
     </resourcetypes>
 
     </resourcetypes>
 
  </documenttype>
 
  </documenttype>
 +
</code>

Revision as of 20:46, 5 August 2008

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