In an environment that includes both Merchandising and Search, the Faceted Search feature enables Commerce sites to provide a navigational structure that is not strictly based on the catalog hierarchy. Facets are like virtual categories that are populated by the results of search queries. Facets are implemented as search refinements, which are used to narrow down search results by searching within those results for only the items that fulfill a certain constraint. For example, a search might return men’s shirts, and then the customer might select a facet value that narrows the results to men’s shirts that are made of cotton.

You specify facets and the logic for determining the selections in Merchandising as part of creating your product catalog. Each facet corresponds to a property of a commerce item, and can be associated with one or more categories or catalogs. Each facet is stored in the RefinementRepository as a separate refineElement repository item. When you deploy your catalog to your production site, the RefinementRepository is deployed as well. When you index your catalog, the data in the RefinementRepository is used to create the refinement configuration files used by Search.

When you write JSPs for displaying facets, you render the facet selection values as hyperlinks. When a customer clicks one of these links, a query is issued to Search, using the selection range or value as a refinement criterion. For example, a customer might issue a text query that returns a set of products that are displayed on the page. If the customer then clicks the Sale Price facet’s “$100 to $200” link, a new query is issued that specifies “return only the products in this set whose sale price is between $100 and $200.” The results of this query are then displayed on the page, and the facet selections are updated.

This chapter describes configurations that enable merchandisers to create and edit facets in Merchandising: