Before you start
- Ranking rules only affect text search results.
- Each rule can be set to Active or Draft. Layers saves draft rules but does not apply them to live searches.
- You can create multiple rules and they all evaluate independently — if multiple rules match the same query, Layers applies all of their actions.
Select a rule type
- Go to Ranking Relevancy and click the Rules tab.
- Click Create Rule.
- Select a rule type:
- Visual editor — Pin products to specific positions using a drag-and-drop grid. Best for curating results for high-value queries.
- Manual rule — Boost or bury products based on attribute conditions and magnitude. Best for broad adjustments across many products.
Create a visual rule
- Enter a name for the rule.
- Type a search query — this is the query the rule targets. Products matching that query load into a grid.
- Drag products into the positions you want them to appear. Layers locks pinned products to their assigned positions.
- To add a product not in the current results, use the search field within the grid to find and add it.
- Click Save to create the rule.
Set a default variant for pinned products
After pinning a product in the visual editor, you can choose which variant to feature in search results:- Click the variant button on the pinned product card.
- Select the option values you want to display (for example, “Color: Blue, Size: Large”).
- Preview the matching variant’s price and image in the modal.
- Click Save to apply.
Create a manual rule
- Enter a name for the rule and set its status (Active or Draft).
- Select a scope:
- Global — The rule applies to every text search.
- Query-specific — The rule only applies when the search query matches a condition you define.
- If you chose query-specific, configure the targeting condition:
- Select a match type: Exact match, Contains, or Semantic match.
- Enter the query value to match against.
- For semantic match, adjust the similarity threshold slider (50–100%) to control how closely a query must relate to trigger the rule.
- Add one or more actions:
- Select Boost, Bury, or Sort.
- For Boost or Bury: select the product attribute to match (e.g., vendor, product type, tags), select an operator and value, and set the strength using the slider (1–50%, labeled Subtle to Strong).
- For Sort: add up to three sorting expressions. Each expression requires a metric attribute, a direction (ascending or descending), and a weight (5–100%) that controls how strongly the metric influences the ranking. See sort action details below.
- To add additional actions, click Add Action. You can combine boost, bury, and sort actions in a single rule.
- Click Save to create the rule.
Add a sort action
A sort action overrides the default relevance-based ordering for searches matching the rule’s targeting conditions. Use it when specific queries should rank results by a metric — like sales or conversion rate — instead of pure relevance.- In the actions section of a manual rule, click Add Action and select Sort.
- Add a sorting expression:
- Attribute — Select the metric to sort by (for example, a 7-day sales metric or a conversion rate metric).
- Direction — Choose Descending to show the highest values first, or Ascending for the lowest values first.
- Weight — Set how strongly the metric influences results (5–100%). Lower weights treat the metric as a tie-breaker among products with similar relevance. Higher weights give the metric more control over ranking.
- To add more expressions, click Add Expression. You can include up to three sorting expressions per sort action.
- Continue adding other actions (boost or bury) if needed, then click Save.
Manage existing rules
From the Rules tab, you can:- Enable or disable a rule using the toggle without deleting it.
- Edit a rule to change its conditions or actions.
- Duplicate a rule to create a copy with the same configuration.
- Delete a rule permanently.
Tips
- Use visual rules for your top search queries where precise product placement matters.
- Use manual rules with global scope to apply broad adjustments, like boosting in-stock products or burying discontinued items across all searches.
- Use sort actions for intent-driven queries where customers expect a specific ordering — for example, sorting by sales for “best sellers” or by price for “affordable.”
- Start with a lower sort weight (10–20%) and increase gradually. A lower weight preserves more of the default relevance ranking while still surfacing metric-driven products.
- Combine exact match targeting for high-volume queries with semantic match for long-tail variations.
- Use the search preview on the signal weights page with ranking rules toggled on to verify rule behavior before going live.
See also
- Ranking relevancy — How signal groups and ranking rules work
- Tune signal weights
- Test text search