> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sorting

> Sort orders determine how products are ranked on collection pages using attributes, priority rules, weighted groups, and soft boost.

## What is sorting in Layers?

Sort orders control the sequence in which products appear on your collection pages. Rather than relying on a single ranking criterion, Layers lets you combine multiple signals — product attributes, priority rules, weighted attribute groups, and soft boost. This lets you create sophisticated sorting strategies that align with your merchandising goals.

## How sorting fits into the platform

Sort orders build upon your [attribute](/core-concepts/attributes) configuration. Only attributes marked as **sortable** can be used in sort orders. Sorting can be enhanced with [sequences](/platform/sequences) to keep related products together, and is subject to [merchandising rule](/core-concepts/merchandising) overrides:

```mermaid theme={null}
graph TD
  A[Attributes] --> B[Sort Orders]
  A --> PF[Product Families]
  B --> C{Sequences Enabled?}
  C -->|Yes| D[Sequences Applied]
  C -->|No| E[Standard Sort]
  D --> F[Collection Results]
  E --> F
  G[Merchandising Rules] --> H{Diversity Enabled?}
  PF --> H
  H -->|Yes| I[Family Caps Applied]
  H -->|No| J[Final Results]
  I --> J
  F --> G
```

## Key sorting capabilities

**Priority rules** are hard overrides that force products to the top or bottom of results based on conditions you define. Promoted products appear at the top and demoted products appear at the bottom. Priority rules are always evaluated first.

**Weighted attribute groups** let you combine multiple sortable attributes and metrics into a single blended score, with relative weights and per-attribute direction (higher or lower is better). For example, you could sort by 60% sales performance and 40% freshness to balance proven sellers with new arrivals. Weighted groups can be combined with soft boost or User Affinity to layer modifiers on top of the blend.

**Soft boost** gently adjusts product positions without creating hard clusters. Unlike priority rules, soft boost interleaves boosted products naturally within the existing sort order for a more organic feel.

**Segmented sorting** lets you personalize product rankings based on visitor context like geographic location or marketing channel, automatically adapting sort behavior for different audiences.

**User Affinity** personalizes browse results for each individual shopper, lifting products that match the tastes Layers learns from that shopper's own cart and purchase history. It applies on collection pages, only promotes (never demotes), and modifies the sort attribute beneath it.

## Next steps

* [Sort orders](/platform/sorting) — Full guide to creating and managing sort orders
* [Priority rules](/platform/sorting/priority-rules) — Hard overrides for product positioning
* [Weighted groups](/platform/sorting/weighted-groups) — Blend several attributes and metrics into a single sort score
* [Soft boost](/platform/sorting/soft-boost) — Gentle, natural ranking adjustments
* [User Affinity](/platform/sorting/user-affinity) — Browse personalization from each shopper's cart and purchase history
* [Segmented sorting](/platform/sorting/segmented-sorting) — Context-aware personalized sorting
* [Sort order recipes](/platform/sorting/recipes) — Pre-configured sort orders to get started
* [Preview & annotations](/platform/sorting/preview) — Testing sort orders before publishing
* [Create a sort order](/help/sort-orders/create-sort-order) — Step-by-step guide
