Skip to main content

Rule Trace

Rule trace shows which merchandising rules applied to a search, in what order, and how they affected the final results.

Overview

Rule trace provides a complete audit trail of which rules were applied, helping you understand how merchandising controls affected search results.

Trace Format

{
"query": "running shoes",
"rules_applied": [
{
"rule_id": "boost_high_margin",
"type": "boost",
"order": 1,
"products_affected": 15,
"impact": "+20% score boost"
},
{
"rule_id": "pin_new_arrivals",
"type": "pin",
"order": 2,
"products_affected": 1,
"impact": "Pinned to position 1"
},
{
"rule_id": "brand_diversity",
"type": "guardrail",
"order": 3,
"products_affected": 8,
"impact": "Limited to 2 per brand"
}
]
}

Best Practices

  1. Show order: Display rules in application order
  2. Show impact: Explain how each rule affected results
  3. Enable filtering: Allow filtering by rule type
  4. Export traces: Enable export for analysis