[opencms-dev] updateindex - different indexsources can't use different document factories.

Ernesto De Santis ernesto.desantis at colaborativa.net
Mon Aug 22 22:52:41 CEST 2005


Hi

OpenCms 6 is a multi site cms, but you can't index contents of same type 
with different document factories (documenttype tag).

In opencms-search.xml you define documenttypes:

            <documenttype>
                <name>xmlpage</name>
                
<class>org.opencms.search.documents.CmsDocumentXmlPage</class>
                <mimetypes>
                    <mimetype>text/html</mimetype>
                </mimetypes>
                <resourcetypes>
                    <resourcetype>xmlpage</resourcetype>
                </resourcetypes>
            </documenttype>   
            <documenttype>
                <name>myxmlpage</name>
                <class>mypackage.MyDocumentXmlPage</class>
                <mimetypes>
                    <mimetype>text/html</mimetype>
                </mimetypes>
                <resourcetypes>
                    <resourcetype>xmlpage</resourcetype>
                </resourcetypes>
            </documenttype>   


When you configure the indexes:

            <indexsource>
                <name>site1</name>
                <indexer class="org.opencms.search.CmsVfsIndexer" />
                <resources>
                    <resource>/sites/site1/</resource>
                </resources>       
                <documenttypes-indexed>
                            <name>xmlpage</name>
                </documenttypes-indexed>
            </indexsource>   
            <indexsource>
                <name>site2</name>
                <indexer class="org.opencms.search.CmsVfsIndexer" />
                <resources>
                    <resource>/sites/site2/</resource>
                </resources>       
                <documenttypes-indexed>
                            <name>myxmlpage</name>
                </documenttypes-indexed>
            </indexsource>   

BUT, both indexes are builded with the same document factory for 
xmlpages. I think that the problem is in
org.opencms.search.CmsSearchManager.getDocumentFactory(A_CmsIndexResource 
resource)

The javadoc of this method:

     * Returns a lucene document factory for given resource.<p>
     * 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.

I think that the intent of this method is bad, in my opinion this need 
to include index information. And return different document factories 
for different index configurations.

Adios amigos, and apologies for my English.
Ernesto.


-- 
Ernesto De Santis - Colaborativa.net
La Plata, Argentina.
http://www.colaborativa.net/


	

	
		
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 




More information about the opencms-dev mailing list