Some search configuration rules can take into account inventory information about the products or SKUs returned by ATG Search. For example, a merchandiser can create rules that exclude items that are out of stock or discontinued.
In order for ATG Search to apply these rules appropriately, it needs to have up-to-date inventory information. To supply this information, services on the client side gather the availability status of the SKUs and products in the catalog, generate XML files with this data, and submit the files to ATG Search.
When Search Administration initiates indexing of the product catalog, it also invokes the /atg/commerce/search/SearchUpdateAdapter
component. This component is a customization adapter that manages the process of generating the inventory data files and submitting them to ATG Search.
The SearchUpdateAdapter
invokes the /atg/commerce/search/config/CatalogInventoryCollector
component. If the assembled application uses product-based indexing, the class of this component is atg.commerce.search.config.ProductInventoryCollector
. For each product in the catalog, this class calls the inventory manager to get the availability status for all of the product’s child SKUs. It then summarizes those statuses into a single overall status for the product.
It does this by choosing the “best” status among the product’s child SKUs. The “goodness” of the different status values is configured by the summaryLogicStatuses
property of the ProductInventoryCollector
class. This property is a list of the availability statuses in descending order of goodness. By default, this property is configured like this:
summaryLogicStatuses=\
IN_STOCK,\
BACKORDERABLE,\
PREORDERABLE,\
OUT_OF_STOCK,\
DISCONTINUED
So, for example, if a product has two child SKUs, and one has a status of BACKORDERABLE
and the other is DISCONTINUED
, the status of the product would be BACKORDERABLE
. Note that if any child SKU’s status is IN_STOCK
, the product status is IN_STOCK
. If you want to change this logic, you can reorder the list. For example, if you put OUT_OF_STOCK
first, then a product will be considered out of stock if any child SKU’s status is OUT_OF_STOCK
.
If the assembled application uses SKU-based indexing (enabled by including the DCS.Search.Index.SKUIndexing
module), the CollectorPropertyService
component’s class is atg.commerce.search.config.SKUInventoryCollector
. This class also calls the inventory manager to get the availability of each SKU, but doesn’t summarize the statuses of a product’s SKUs into an overall product status.
For more information about the inventory manager and availability statuses, see the ATG Commerce Programming Guide.