As a customer navigates the catalog, Commerce Reference Store displays facet values on the left side of the page. For example, the facets for the Men’s Shoes category include Price, Size, and Color:

This illustration is described in the surrounding text.

Note that depending on the set of products displayed, certain facets may not appear. In the image above, the Features facet does not appear, because the features property is null for all men’s shoes.

Search determines which facets and results to return based on the facet trail submitted with the faceted search request. When a customer enters a free-text search query, a new facet trail is created containing the SRCH facet. So, for example, if the customer searches for “feather,” the facet trail is:

SRCH:feather

Search returns results from the free-text search and displays the facets associated with the lowest-level ancestor category that is common to all of the returned items. (“Lowest-level” means furthest from the root category, which is considered the top of the catalog hierarchy.) This behavior is enabled by the following properties of the /atg/commerce/search/catalog/QueryRequest component:

refineConfig=$map
refineConfigMapProperty=ancestorCategories.catalogSpecificId

Setting the refineConfig property to $map instructs 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.

As the customer makes facet selections, they are appended to the facet trail, so that the results returned are only those products that satisfy both the text query and the facet selections. So if the customer searches for “skirt” and then selects the Green value for the Color facet, the facet trail looks something like this:

SRCH:skirt:1002:Green

The facet trail is reset if the customer uses category navigation (e.g., selects Home Accents > Clocks from the category bar near the top of the page), or enters a new free-text search.