[opencms-dev] Configuring which xmlcontent fields to search

Mario Jäger m.jaeger at alkacon.com
Tue Apr 27 09:43:42 CEST 2010


Hi Paul,

one possibility is that you map each of the elements "PageTitle", "Intro" and "Paragraph" 
with one property. In the WEB-INF/config/opencms-search.xml you have to add in the section 
<fieldconfigurations> the new fields for the index analogue to the "description" field:

<field name="description" display="%(key.field.description)" store="true" index="true">
  <mapping type="property">Description</mapping>
</field>

That you can add in an existing index and you can add that in a new index which only uses 
your specific XML contents.

---
Kind Regards,
Mario.
 
-------------------
Mario Jäger
 
Alkacon Software GmbH  - The OpenCms Experts                    
http://www.alkacon.com - http://www.opencms.org


Paul-Inge Flakstad schrieb:
> Hi everyone,
>  
> I'm wondering if there's an easy way to configure which fields of an 
> xmlcontent file to index?
>  
> E.g. if the XSD contains these element definitions:
>  
> <xsd:sequence>
>     <xsd:element name="PageTitle" type="OpenCmsString" />
>     <xsd:element name="Extension" type="OpenCmsExtension" 
> minOccurs="0" maxOccurs="1" />
>     <xsd:element name="Intro" type="OpenCmsHtml" minOccurs="0" 
> maxOccurs="1" />
>     <xsd:element name="Paragraph" type="OpenCmsParagraph" 
> minOccurs="0" maxOccurs="unbounded" />
> </xsd:sequence>
>  
> I don't want the "Extension" element to be searchable, but I do want 
> the rest of the fields searchable.
>  
> Is there a simple solution?
>  
> Cheers,
> Paul
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list