Search refinements, sorting rules and sorting options
Building the refinement bar and the product order: category refinement definitions and their inheritance, value buckets, the refinement Script API, sorting rule layers and tie-breaking, category-level rule assignment, storefront sorting options, and how script calls pick the effective rule.
Given a business requirement, create and configure a new search refinement and sorting definition that can be used on the storefront.
~7 min read · 9 practice questions ·
What the exam expects
- Create an attribute refinement on the right category, knowing that subcategories add to inherited definitions, and group raw values into buckets.
- Pick the
SearchRefinementsmethod that fits the panel: filtered definitions, all definitions, or broadening values. - Build a sorting rule from layered attributes, break ties deliberately, and use Category Position correctly.
- Assign a rule to the root or a subcategory, and add a shopper choice to Sort By with a storefront sorting option.
- Predict which rule a
ProductSearchModeluses when script sets a rule or option.
Key terms: refinement definition (a category-level setting that turns an attribute, category, price or promotion into a filter); bucket (a group of raw values shown as one refinement option); deepest common category (the lowest category that contains the whole result); sorting rule (an ordered list of attributes, each with a direction); storefront sorting option (a site-wide Sort By entry that points at a sorting rule).
Key facts
- Detail
- Root-to-deepest-common-category definitions are concatenated
- Detail
- Defined on the storefront catalog's root category
- Detail
- Can't be refinements
- Detail
- Needs a full index rebuild
- Detail
- Single-value; online or searchable not required
- Detail
- Not applied to products, so sorting ignores it
- Detail
- Placed last in either direction
- Detail
- Needs
Manage_Global_Sorting_Rules; global dynamic attributes only
- Detail
- Site-wide; up to 100
Sources for this section (7)
- Class SearchRefinementsdeveloper.salesforce.com (opens in a new tab)
- Create New Search Refinementshelp.salesforce.com (opens in a new tab)
- Use Custom Object Definitionsdeveloper.salesforce.com (opens in a new tab)
- Search Refinement Bucketshelp.salesforce.com (opens in a new tab)
- Create Sorting Ruleshelp.salesforce.com (opens in a new tab)
- How Sorting Rules Workhelp.salesforce.com (opens in a new tab)
- Storefront Sorting Optionshelp.salesforce.com (opens in a new tab)
- When a script sets both a sorting option and a sorting rule on one model, which is used?
- Why can a blocked refinement still appear in a subcategory?
- When is a Text Relevancy setting of No the right choice?
- Which buckets need no manual value assignment?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the B2C Commerce Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the B2C Commerce Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Practice exams purchase adds inline bank questions and topic practice (9 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Choose guide-only, practice-only, or save $4 with both