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 sites 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.
The targeting ruleset that IndexedItemsGroup
uses varies depending on whether your site uses the standard catalog or custom catalogs. For the standard catalog, the rule is:
<!-- products whose "ancestorCategories" property includes an item whose "root" property is true. --> <ruleset> <accepts> <rule op="includesItem"> <valueof target="ancestorCategories"> <rule op=eq> <valueof target="root"> <valueof constant="true"> </rule> </rule> </accepts> </ruleset>
The ruleset for custom catalogs (which overrides the standard catalog rule if you run the DCS.Search.CustomCatalogs
module) is:
<!-- products whose "catalogs" property is not null. --> <ruleset> <accepts> <rule op=isNotNull> <valueof target="catalogs"> </rule> </accepts> </ruleset>