Steps
- Go to Sort Orders and click Create.
- Add simple rules (like newest or price) or combine a few signals.
- Give the sort order a clear name so your team knows when to use it.
- Save your sort order.
How rows rank
Rows rank from top to bottom. The first row sets the main order, and each later row only breaks ties left by the rows above it. A row has no effect on products the rows above it already separated.- Put a yes/no attribute such as In stock first to create tiers, like “in-stock products first”.
- A soft boost applies to the row directly below it. Put the boost right above the metric it should nudge within.
- Don’t put a soft boost directly above a yes/no attribute. Instead of nudging, the boost lifts every matching “yes” product above all other “yes” products, and the rows below no longer decide their order. The editor warns you when a boost is in this position.
Sorting attribute types
The Add Expression menu offers simple attributes (Metric and Product Attribute) plus several specialized expression types: Promote and Demote (priority rules), Weighted Group, Soft Boost, Product Diversity, and Sequence Grouping. On relevance sort orders, the relevance expression is labeled Search Relevance.Simple attributes
Sort by product attributes like price, title, or sales metrics. Simple attributes are the most common sort expressions.You can attach an Only when… condition to any value sort term so products that don’t qualify fall through to the next expression instead of ranking on an unreliable signal. See Conditional sort expressions for the full guide.
Date bucketing
When the sort attribute is a date (for example,created_at, published_at, or updated_at), a Bucket dropdown appears next to the direction control. Select a bucket to round each product’s date down to the start of that period before Layers sorts on it.
- Options: No bucket (default), Hour, Day, Week, Month, Quarter, Year.
- When to use it: If your store launches many products in the same short window, raw timestamps make every product a unique value. A date attribute placed after another sort then acts as a fine-grained tiebreaker and can shuffle the primary order. Rounding to Day, Week, or Month groups products that shipped in the same period so the earlier expression stays in control and the date only breaks true ties.
- How it applies: Layers applies the bucket wherever the date attribute contributes to sorting: as a value sort, as a tiebreaker, as a feature inside a weighted group, or as the base attribute a soft boost modifies.
Priority rules
Boost or demote products matching specific conditions. Priority rules cluster matching products at the top or bottom of results based on their direction setting:- Descending direction: Promotes matching products to the top
- Ascending direction: Demotes matching products to the bottom
Soft demotion
When demoting products in a search context, enable Soft Demotion to apply threshold-based relevance demotion. Items above the relevance threshold are immune to demotion, while items below receive proportional demotion. When available:- Only appears for priority rules on relevance sort orders
- Only applies in search context (not browse)
- Only available for demotion direction (ASC)
- Items with relevance score >= threshold → immune to demotion
- Items with relevance score < threshold → proportional demotion based on distance below threshold
- Default: 0.5 (range: 0-1)
- Higher threshold (e.g., 0.7): Only highly relevant items are immune; more products receive demotion
- Lower threshold (e.g., 0.3): More items are protected; only weak matches receive demotion
- Enable the Soft Demotion toggle
- Adjust the Relevance Threshold slider (0-100, representing 0.0-1.0)
- The slider displays the current threshold value
- Items with relevance at or above this threshold are immune to demotion
equals/does not equal- Exact matchcontains/does not contain- Partial text matchingbegins with/does not begin with- Prefix matchingends with/does not end with- Suffix matchingin/not in- Match any value in a list (enables multi-select)is null/is not null- Check if attribute has a value (hides value field)
equals/does not equal- Exact numeric matchgreater than/greater than or equal- Value comparisonsless than/less than or equal- Value comparisonsbetween/not between- Range matching (requires two values)in/not in- Match any value in a list (enables multi-select)is null/is not null- Check if attribute has a value (hides value field)
equals/does not equal- Exact date matchafter/before- Date comparisonsbetween/not between- Date range matching (requires two values)in the last (days)- Matches dates within the last N days of now. The window stays current as time passes, so it always tracks a rolling period. Use it for “new arrivals” style rules that should follow the calendar without manual updates.is null/is not null- Check if attribute has a value (hides value field)
contains/does not contain- Check if tag existsin/not in- Match any tag in a list (enables multi-select)
in or notIn operators:
When you select the in or notIn operator in the UI, the UI automatically enables multi-select, so you can select multiple values in a single rule.
is null or is not null, the UI automatically hides the value field since these operators check for presence/absence of data.
not between:
Weighted groups
Combine multiple attributes and metrics into a single sort score. Each feature contributes a configurable share of the blend, and you choose whether higher or lower values are better on a per-attribute basis. See Weighted groups for the full guide. Configuration:- Expressions — the attributes and metrics to blend. Use the picker on each row to select a feature. A group can contain a single feature, though a blend is most useful with two or more. The metric picker groups metrics by section (with your three most recently used metrics floated to the top) and offers a Create metric… action to build a new metric inline without leaving the sort order. See Weighted groups for details.
- Preference (attribute rows only) — Higher is better or Lower is better. Sets the direction each attribute contributes in. Metric rows default to higher is better.
- Weight — a share of 100, controlled with a slider. Layers automatically normalizes weights so they always sum to 100; dragging one slider rebalances the others proportionally.
- Final Sort Direction — set in the group settings sheet. Controls how products are ordered by the final blended score (Descending by default).
- Conditions — optional contextual conditions in the group settings sheet that gate the entire group. When the conditions don’t match a request, the whole weighted group is skipped.
Soft boost
Lift products matching conditions toward a target score while maintaining natural ranking. Unlike priority rules, soft boost creates interleaving rather than clustering. Each soft boost appears with a Modifier badge and is visually grouped beneath the metric or attribute it modifies, so you can see at a glance which expression the boost targets. Key differences from priority rules:- Natural interleaving: Boosted products are distributed throughout results based on their base score.
- Capped lift: Products are only lifted as far as needed to reach the target band.
- Requires a target expression: Soft boost modifies the next metric or attribute in the list.
- Attribute: The product attribute to check (for example, tags, vendor, options).
- Operator: Condition operator (see available operators below).
- Value: The value to match (multi-select available for
inandnotInoperators, hidden foris nullandis not null). - Boost Mode: Select Nudge matches up (multiplicative, default) or Lift matches into view (additive).
- Nudge matches up: Gives matches a small multiplier that’s strongest on low scores and fades on high ones. Products with no metric data don’t move.
- Lift matches into view: Best for products that may not have metric data yet, like new arrivals or restocks. Places matched products at the chosen spot in the results, including ones that would rank higher on their own.
- Boost Strength (Nudge matches up only): Amplitude of the multiplier applied to the base score (default: 0.25, range: 0-10; the editor slider covers 0-2, and negative values aren’t allowed). Lift matches into view does not use this value.
- Percentile Target (Lift matches into view only): Where boosted products land (default: 50, range: 0-100). With spacing on, 75 starts matches about a quarter of the way down the results. With spacing off, matches are lifted to the base metric’s value at that percentile.
- Min positions between (both modes): Number of non-matched products between two consecutive boosted matches in the final results (default: 10, range: 1–50). Prevents clustered matches from landing adjacent. Layers treats the value as a maximum and tightens the gap automatically when a smaller result set cannot fit the full spacing. In Nudge matches up, a single match stays put and only clustered matches are spread. In Lift matches into view, matches are laid out from the percentile anchor.
- Text operators:
equals,does not equal,contains,does not contain,begins with,does not begin with,ends with,does not end with,in,not in,is null,is not null - Numeric operators:
equals,does not equal,greater than,greater than or equal,less than,less than or equal,between,not between,in,not in,is null,is not null - Date operators:
equals,does not equal,after,before,between,not between,is null,is not null - Tag operators:
contains,does not contain,in,not in
in operator:
When you select the in or notIn operator in the UI, multi-select is automatically enabled.
- Boosting products with zero or near-zero base values (new arrivals with no sales)
- Creating a specific target position in the sort order
- “Sprinkling” new products into established rankings
Product Diversity
Spread products from the same group across results so a single group doesn’t dominate the top of a collection. Add one or more diversity axes. Each axis caps repeats on a different dimension (product family, product type, vendor, or any categorical attribute). See Diversity expressions for the full set of options. If your cap hides strong sellers, turn on Let top sellers past the cap to allow a limited number of extra sellers per family. You leave the normal cap unchanged for other products. The exception is off by default; see top seller exception settings and defaults before you enable it.Sequence Grouping
Keep related products grouped together according to a configured sequence while the rest of the sort order ranks around them. Adding a Sequence Grouping expression enables sequences for a sort order. Once you save the expression:- The sort order appears in the sort order dropdown when you create a product sequence.
- Selecting the sort order in a merchandising rule shows the Enable Sequences toggle, which turns on automatically. Sort orders without a Sequence Grouping expression don’t show that toggle.
AI-suggested expression names
When you add or edit a sort expression, Layers automatically suggests a short, plain-language label for it based on the attribute, operator, and values you configured. The suggested name appears as the card title in the editor. How it works:- As soon as you finish editing an expression, Layers sends the configuration to a small language model and replaces the placeholder title with the generated name.
- Names are deterministic for the same configuration and cached, so identical expressions across different sort orders share the same label.
- You can always rename an expression manually by clicking the title. Your edit is preserved and won’t be overwritten.
Tips
- Start simple. You can refine weights over time.
- Use soft boost for subtle promotion that maintains organic ranking.