What is Sorting?
Sorting orders a result set by a chosen field or rule such as price, rating, popularity, or newest. Unlike ranking (which blends many signals), sorting applies a clear, user-selected order with predictable tie-breakers.
How It Works (quick)
- Typed fields: Price/date/rating stored as numeric/date doc values for fast sort.
- Stable order: Add tie-breakers (e.g., score → rating → reviews → ID) to avoid jitter.
- UI controls: Dropdown or tabs (Relevance, Price ↑/↓, Newest, Rating).
- URL/state: Expose
sort=price_asc
in the query string for shareable links. - Guardrails: Apply hard filters (in-stock/ACL) before sorting; cap page size.
Why It Matters in E-commerce
- Decision speed: Users can zoom in on what matters (budget, quality, freshness).
- Transparency: Predictable order reduces frustration and boosts trust.
Best Practices
- Default to Relevance; keep sort options short and meaningful.
- Normalize currency and units per locale before sorting.
- Use review count as a secondary key for rating sorts.
- Hide price sort for mixed bundles where price is unclear.
- Cache popular sorts; precompute aggregations.
Challenges
- Mixed currencies/units, sparse ratings, popularity bias, and large tie groups.
Examples
- Category page: Relevance default; tabs for Price Low–High, Price High–Low, Rating, Newest.
- B2B: sort by lead time or spec (e.g., torque, wattage).
Summary
Sorting gives users control over order. Keep it fast, stable, localized, and secondary to a strong relevance default.