You may be able to reduce the size of your index by filtering the property values to remove redundant entries. For example, suppose a record represents a product whose SKUs have a size
property, with values of small, medium, and large; multiple SKUs have the same size
value, and are differentiated by other properties (e.g., color
). The entries for size
in a record might be:
<PROP NAME="sku.size">
<PVAL>medium</PVAL>
<PVAL>large</PVAL>
<PVAL>medium</PVAL>
<PVAL>small</PVAL>
<PVAL>medium</PVAL>
<PVAL>small</PVAL>
</PROP>
By filtering out redundant entries, you can reduce this to:
<PROP NAME="sku.size">
<PVAL>medium</PVAL>
<PVAL>large</PVAL>
<PVAL>small</PVAL>
</PROP>
To automatically perform this filtering, specify the UniqueFilter
class in the XML definition file:
<property name="size" filter="unique"/>
As a general rule, it is a good idea to specify the unique
filter for a property if multiple items in a record may have identical values for that property. If you specify this filter for a property and every value of that property in a record is unique (or if only one item with that property appears in the record), the unique
filter will have no effect on the record (either negative or positive). However, executing this filter increases processing time to create the record, so it is a good idea to specify it only for properties that will benefit from it.