[opencms-dev] Search on different fields of structured content type.

Christoph Schönfeld cschoenfeld at sylphen.com
Wed Oct 18 12:33:58 CEST 2006


As far as I understand OpenCms correctly what you want is possible by 
providing a custom Lucene Document Factory (which implements 
org.opencms.search.documents.I_CmsDocumentFactory) as part of your own 
custom OpenCms Document Type class. Your implementation of the interface 
method 
"org.opencms.search.documents.I_CmsDocumentFactory.newInstance(cms: 
CmsObject, resource: A_CmsIndexResource, language: String): 
org.apache.lucene.document.Document" should be able to add the custom 
fields you need to the returned Lucene Document.

This class has probably to appear as the "Document type class" in the 
search index source frontend (Administration View >  Search Management 
 >  View index sources >  Index source overview).

See org.opencms.search.documents.CmsDocumentXmlPage for an example of 
such a class. It extends A_CmsVfsDocument which implements the afore 
mentioned interface.

I plan to use this approach for my own project, though I did not yet 
validate it and I do not yet know how to build the customized search on 
top of it.


Christoph


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061018/6c7c7d8c/attachment.htm>


More information about the opencms-dev mailing list