In some cases, you may want to output the values of a property for some repository items of a certain type but not for others of that type. For example, you may want to output the value of the longDescription
property of most product
items, but omit this property for a few specific product
items.
The Oracle Commerce Platform includes an interface, atg.repository.search.indexing.IndexingPropertyFilter
, for filtering properties of specific repository items. This interface defines a single method:
filterOutputProperties(RepositoryItem pItem,
OutputProperty[] pOutputProperties)
This method is used to implement the logic that determines which property values to exclude from output records.
The Oracle Commerce Platform also includes a class that implements this interface, atg.repository.search.indexing.filter.GSAPropertyFilter
. This class has two properties that are used to specify the property values to exclude:
idToType
A Map in which the keys are IDs of repository items and the values are their item types.
propsToFilter
A List of the properties of the items specified byidToType
whose values should be excluded from the output. Note that the property names you supply should be the output names used in records, after any prefix or suffix replacement or property renaming.
To apply a GSAPropertyFilter
component to an item type, you use the filter
attribute of the item
element in the EndecaIndexingOutputConfig
definition file.
The filterOutputProperties()
method of the GSAPropertyFilter
class examines the idToType
property to see which repository items to filter.
You can create other components of class GSAPropertyFilter
and configure the idToType
and propsToFilter
properties to filter different item types and properties, or you can implement different filtering logic by writing your own class that implements the IndexingPropertyFilter
interface.