Custom catalog searches in development mode are performed slightly differently than searches in production mode. The two main differences are:
- the five preconfigured search components become instances of - atg.commerce.catalog.FilteringSearchFormHandler
- the - /atg/commerce/catalog/RepositoryValuescomponent becomes an instance of- atg.commerce.catalog.FilteringCatalogPossibleValues.
The following example demonstrates the different ways the two modes retrieve the same results.
- In production mode: The - SearchFormHandlerand- CatalogPossibleValuesclasses add a clause to the query that they pass to the repository that restricts the search results to the user’s current catalog. If a user does a keyword search for “red” in production mode, the query includes a “where- keywordStringCONTAINS ‘red’” clause and the- SearchFormHandleradds another clause to make the query “where- keywordStringCONTAINS ‘red’ and- catalogsCONTAINS (the user’s current catalog)”. Therefore, the repository would only return items that exist in the user’s current catalog.
- In development mode: The - catalogsproperty of categories, products, and SKUs is derived and non-queryable. So the- SearchFormHandlercannot add the extra clause to narrow the search to only the user’s current catalog. Instead, the query is run without the extra clause and items not in the user’s current catalog may be returned. Before returning the result set,- FilteringCatalogSearchFormHandlerthen iterates through the results, and checks the- catalogsproperty of each. Those items that do not contain the user’s current catalog among their- catalogsare then removed from the list, and the “filtered” result set containing only items in the user’s current catalog is returned.

