When a customer submits a text query, the QueryFormHandler has no information for selecting a refinement configuration. In this situation, Oracle ATG Web Commerce Search can determine the refinement configuration based on the items that are returned from the query. This behavior is configured in the /atg/commerce/search/catalog/QueryRequest component through the following settings:

refineConfig=$map
refineConfigMapProperty=ancestorCategories.catalogSpecificId

Setting the refineConfig property to $map instructs Oracle ATG Web Commerce Search to select the refinement configuration by finding a metadata property value common to all of the results; refineConfigMapProperty specifies which metadata property to use. The value of the specified property, ancestorCategories.catalogSpecificId, is an array of the catalog-specific category IDs of a product’s ancestor categories. (Each ID is formed by combining the category ID with the catalog ID.) The value of ancestorCategories.catalogSpecificId is determined by the /atg/commerce/search/CustomCatalogCategoriesPropertyAccessor component, which is a property accessor of class atg.commerce.search.producer.CustomCatalogCategoriesPropertyAccessor.

These settings specify that Oracle ATG Web Commerce Search should use the refinement configuration associated with the lowest-level catalog-specific ancestor category that is common to all of the returned items. This refinement configuration includes the global facets plus any facets specific to that category. If there is no ancestor category common to all of the results, a refinement configuration that includes only global facets is used.

For example, suppose your site has several root categories, including Electronics, Shoes, Books, etc. The hierarchy of the Electronics category looks like this:

Let’s say a customer searches for “Acme”. The search results consist only of TVs and stereos manufactured by Acme Audiovisual. So the lowest-level ancestor category that is common to all of the returned items is Home Theater. Oracle ATG Web Commerce Search uses the refinement configuration associated with this category.

Another customer searches for “Cogswell”. This time, the results consist of TVs and stereos manufactured by Cogswell Inc., but also books written by an author named Russell Cogswell. The results therefore do not have a common ancestor category, so Search uses only the global facets.