You can limit the set of items to index by setting the IndexingOutputConfig
component’s repositoryItemGroup
property to a component whose class implements the atg.repository.RepositoryItemGroup
interface. This interface defines a logical grouping of repository items. Only the items that are included in this logical grouping will be included in the index.
For example, many commerce applications display search results only for items that can also be viewed by browsing the catalog hierarchy. To be viewed this way, a product must have an associated category. Therefore, the ProductCatalogOutputConfig
component’s repositoryItemGroup
property is set by default to /atg/commerce/search/IndexedItemsGroup
. The IndexedItemsGroup
component uses a targeting ruleset to select only products that are properly categorized. Note that IndexedItemGroup
has a repository
property that specifies the repository that the items are selected from; this must match the repository that the ProductCatalogOutputConfig
is associated with.
It is also possible to specify a repository item group in the indexing definition file using the repository-item-group
attribute of the top-level item
element. If a repository item group is specified in the definition file and also by the component’s repositoryItemGroup
property, the value set by the repositoryItemGroup
property overrides the value set in the definition file.
IndexedItemsGroup
uses the following targeting ruleset, which returns all products that have ancestor catalogs:
<ruleset> <accepts> <rule op=isNotNull> <valueof target="computedCatalogs"> </rule> </accepts> </ruleset>