Many sites that use faceted search support selecting only a single value or range for a given facet. When a user clicks a link to make a selection, a search query is issued that specifies that selection as a constraint. So, for example, for a Color facet, when a customer clicks the link for the Red selection value, a search query is issued that returns only items whose color property is red.

Some sites allow users to make multiple selections for certain facets. For these facets, rather than encoding the selections as hyperlinks, each selection typically has an associated checkbox, so the user can choose multiple selections by checking their checkboxes; a separate button is provided to issue the query once the selections are chosen. (Encoding the individual selections as hyperlinks is also possible, but results in more queries being issued.)

Multiple selections can be combined either with Boolean OR or Boolean AND logic:

If multiple facet values are selected, you need a way to encode them in the facet trail. To specify multiple selections combined with Boolean OR, use the pipe (|) character. For example, to encode the Yellow and Orange selections for a Color facet, the facet trail entry for this facet would look something like this:

3:Yellow|Orange

To specify multiple selections combined with Boolean AND, use the dollar sign ($) character. For example, to encode the Letter and A4 selections for a Paper Size facet, the facet trail entry for this facet would look something like this:

3:Letter$A4

You can use the /atg/commerce/search/refinement/FacetTrailString component to construct facet trails that include facets with multiple selection values. This component, which is of class atg.repository.search.refinement.FacetTrailString, provides methods for adding facet values, including multiple selection values combined with Boolean OR or Boolean AND, to the facet trail string.