By default, the output name of a dynamic property in generated records is:
item-type
.property-name
For example, a weight
dynamic property of the sku
static item type would appear in the MDEX as sku.weight
. You can override the default output property name by setting the optional outputName
attribute for the dynamic property. For example, for a property to appear as sku.weightInGrams
:
<add-item item-descriptor="das_gsa_dynamic_attr" id="weightAttr1" no-checkin="false"> <set-property name="attribute_name"><![CDATA[outputName]]></set-property> <set-property name="item_descriptor"><![CDATA[sku]]> </set-property> <set-property name="property_name"><![CDATA[weight]]></set-property> <set-property name="repository"> <![CDATA[/atg/commerce/catalog/ProductCatalog]]></set-property> <set-property name="is_dynamic_property"><![CDATA[true]]></set-property> <set-property name="data_type"><![CDATA[string]]></set-property> <set-property name="value"><![CDATA[sku.weightInGrams]]></set-property> </add-item>
The outputName
attribute is equivalent to the output-name
attribute in EndecaIndexingOutputConfig
definition files.
For dynamic properties of dynamic subtypes, be sure to use the outputName
attribute to specify the output name, even if you are not overriding the default value. Doing this ensures that the correct item-type
prefix is included. For example, if you have an electricalProduct
subtype of the product
item type, and you add a wattage
property to electricalProduct
, you could specify the output name as follows:
<add-item item-descriptor="das_gsa_dynamic_attr" id="wattageAttr4" no-checkin="false"> <set-property name="attribute_name"><![CDATA[outputName]]></set-property> <set-property name="item_descriptor"><![CDATA[electricalProduct]]> </set-property> <set-property name="property_name"><![CDATA[wattage]]></set-property> <set-property name="repository"> <![CDATA[/atg/commerce/catalog/ProductCatalog]]></set-property> <set-property name="is_dynamic_property"><![CDATA[true]]></set-property> <set-property name="data_type"><![CDATA[string]]></set-property> <set-property name="value"><![CDATA[electricalProduct.wattage]]></set-property> </add-item>