close

Filter

loading table of contents...

Search Manual / Version 2210

Table Of Contents

5.4.3.2 Mapping of Property Types

The CAE Feeder supports String, Number, Date, XML and binary element types. The following table describes the default mapping from Java bean property value classes to element types:

property value class element type
com.coremedia.cap.common.Blob Binary
java.util.Date and java.util.Calendar Date
com.coremedia.xml.Markup XML
java.lang.Number and primitive number types Number
java.lang.String String
java.lang.Collection with elements of above types depends on collection's element type

Table 5.2. Feedable Element Types for Java Bean Properties


Values of other classes map to String elements with the value of their toString method. Collections must contain elements of one type, otherwise the value of the elements' toString method will be used.

Blob values will only be added if their size does not exceed the maximum size configured in application property feeder.beanPropertyMaxBytes (defaults to 5MB). Larger blob values are simply skipped. You can also overwrite the maximum for specific mappings with method setBeanPropertyMaxBytes of the BeanFeedableMapping and BeanPropertyFeedableElementMapping classes.

Collection elements can be used to feed multi-value fields in Apache Solr.

You can configure a property converter to convert the value to one of the supported types. A property converter implements the interface com.coremedia.cap.feeder.bean.PropertyConverter and can be configured with the propertyConverter property of the BeanPropertyFeedableElementMapping. Property converters are for example useful when indexing collection properties. The property converter implementations com.coremedia.cap.feeder.bean.CollectionPropertyConverter and com.coremedia.cap.feeder.bean.CollectionToStringPropertyConverter can be used for this purpose. Please see the Javadoc for details.

Furthermore, it is possible to configure a default value which should be indexed if a bean property is null or a configured PropertyConverter returns null. A default value can be configured with the defaultValue property of the BeanPropertyFeedableElementMapping. Again, please see the Javadoc for details.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.