Before you start
- Ranking rules only affect text search results.
- New rules are created as Draft by default. Draft rules are saved but do not affect live searches until you publish them.
- You can create multiple rules and they all evaluate independently. If multiple rules match the same query, Layers applies all of their actions.
Save and publish workflow
When you are building or editing a rule, you have two separate primary actions:- Save Changes — Saves the rule’s current configuration in place. If the rule is not yet published, it stays in Draft status and is not applied to live searches.
- Publish — Saves the rule and marks it as Published, so Layers applies it to live searches.
Select a rule type
- Go to Relevancy → Ranking Rules.
- 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 Rules — Promote or demote products based on attribute conditions and magnitude. Best for broad adjustments across many products.
Create a visual rule
- Click the rule name in the page header and type a name for the rule.
- Type the search 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 Changes to save the rule as a draft, or click Publish to save and immediately apply the rule to live searches.
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
- Click the rule name in the page header and type a name for the rule.
- Select a scope:
- All searches: The rule applies to every text search.
- Matching searches: The rule applies when its conditions match the query, shopper or traffic context, applied filters, or active sort.
- If you chose Matching searches, build the targeting conditions:
- Combine conditions with nested AND and OR groups.
- For a query condition, select Exact match, Contains, or Semantic match, enter the query value, and, for semantic matching, adjust the similarity threshold slider (50–100%).
- Add conditions for shopper or traffic context, applied filters, or the active sort when needed.
- Add one or more actions:
- Select Promote Products, Demote Products, Sort Expression, Filter Results, Signal Weights, or Spread Results.
- For Promote Products or Demote Products: select a supported product or variant attribute in the Attribute picker, then select an operator and value. Product examples include vendor, product type, and tags; variant examples include price and availability. Set the strength using the slider (1–50%, labeled Subtle to Strong). If the attribute has facet value groups, the value picker lists each group first with a Group badge, followed by ungrouped raw values. Selecting a group matches every raw member.
- For Sort Expression: 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.
- For Filter Results: build the nested filter conditions that determine which products remain eligible. The hidden filter is combined with system filters using AND and does not appear as a shopper-selected facet. See add a Filter Results action.
- For Signal Weights: adjust the five-group weight distribution that should apply for matched requests. Every possible matching path must include a query condition. See add a Signal Weights action.
- For Spread Results: cap how many products from the same product family or attribute can appear near the top of results. See add a Spread Results action.
- For Default Selected Options, see Set default selected options to choose preferred option values for matching searches.
- To add more actions, click Add action. You can combine Promote Products, Demote Products, and Sort Expression actions in a single rule. A rule can carry at most one Signal Weights action.
- Click Save Changes to save the rule as a draft, or click Publish to save and immediately apply it to live searches.
Target what a query asks for
Query dimensions turn a search into labels drawn from a product attribute. For example, a Color dimension can label “blue summer dress” as blue, so a ranking rule can promote products in the color the shopper requested without a separate rule for every color.Create and check a query dimension
You need permission to edit ranking rules to manage dimensions. The default Values selection includes every value. Keep all values selected to include them all, or narrow the selection to at most 150 values. If the attribute has more than 150 distinct values, narrow the Values selection before creating the dimension. Values added to the attribute later are not included automatically when you narrow the selection.- Open Query Dimensions and click Create Dimension.
- Enter a Name and Code, choose the Attribute whose values you want to recognize, and keep all Values selected or narrow the selection to at most 150 values. If the attribute has more than 150 distinct values, you must narrow the Values selection. The code cannot change after creation.
- Write Instructions explaining when each value applies, when it does not, and when the query has no relevant signal. Include ambiguous examples, not only obvious matches.
- Click Create dimension. Layers generates keyword rules and checks them in the background. The page shows the progress.
- Review the generated rules and the Preview table. Add Corrections for exact search words that need a different label or no signal. Review the Corrections list and remove a correction when you no longer need it.
Refine the rules
In Rules, use Test a search to check how the current rules classify a query. Add a Phrase for whole-word matching, or a Word pattern when you need to recognize variations of a single word. Matching ignores case, apostrophes, and plural endings. Choose Labels, leave them empty for a known no-signal phrase, or enable Ask the LLM for context-dependent matches. Click Save rules to apply your changes to subsequent searches and start another comparison with AI labels. Review any warning about rules that were not saved; unsupported patterns or labels outside the selected attribute’s values need correcting.Review the preview
The dimension’s Preview uses top searches from the last 30 days and displays up to 100 searches in a searchable table. Use All, Needs review, No label, and Corrected to filter the table, then search to narrow the displayed rows. The dimension Preview is a classification preview, not a product-results preview. When a search needs a different label, click Fix label, select one or more labels in the popover, and click Save. For a known no-signal search, choose No label instead. The Corrections section lists saved corrections and lets you remove one when you no longer need it. Contact Customer Care if a check continues failing after Recheck.Use labels in ranking rules
- For Matching searches, choose Query asks for: {dimension name} and select the label condition you need. The condition targets what the query requests, not the shopper’s audience membership.
- For Promote Products or Demote Products, use Value: from query and select a dimension. Layers matches products against the values recognized in that query, using the dimension’s product attribute.
Preview a manual rule before saving
The Preview panel on manual rule create and edit pages compares the current search results with your unsaved rule changes.- Enter a search query with at least two characters.
- Select Before to see results without this rule. Other published rules still apply.
- Select After to see results with your current edits. The preview assumes this rule’s targeting conditions match, even if it is a draft.
- Adjust the actions and compare again. Nothing is saved or published by previewing.
The manual rule preview tests the rule’s effects, not whether a shopper or query satisfies its targeting conditions. It does not simulate a particular shopper. Review your targeting separately before publishing.
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 Expression.
- Add a sorting expression:
- Attribute — Select the metric to sort by (for example, a 7-day sales metric or a conversion rate metric).
- Direction — Select Highest to Lowest to show the highest values first, or Lowest to Highest 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 (promote or demote) if needed, then click Save Changes to save as a draft or Publish to apply the rule to live searches.
Add a Filter Results action
A Filter Results action adds a hidden eligibility filter to the requests that match the rule. The filter is combined with system filters using AND, so only eligible products remain. It does not appear as a shopper-selected facet.- In the actions section of a manual rule, click Add action and select Filter Results.
- Build the filter with the nested AND/OR filter builder.
- Save the rule as a draft and preview it before publishing.
Add a Signal Weights action
A Signal Weights action replaces your store’s global signal weight distribution for the queries this rule matches. Use it when a specific query pattern needs a different balance than the rest of your catalog. For example, you can boost inventory weight for"in stock" queries, or push image similarity higher for visually-driven queries like "blue floral dress".
Signal Weights actions are available for manual rules using Matching searches when every possible matching path includes a query condition. Choose Matching searches rather than All searches to use this action.
- In the actions section of a manual rule using Matching searches, click Add action and select Signal Weights. The editor seeds the action with your store’s current pie so you can adjust from there.
- Adjust each signal group’s contribution by dragging its slider or typing an exact percentage between 1 and 80. The other groups rebalance automatically so the total stays at 100%. See Tune signal weights for what each signal group measures.
- To fine-tune sub-signals, click the chevron next to a group to expand it. When you leave a group’s sub-signals untouched, it inherits your store’s current sub-signal ratios.
- Save the rule as a draft and preview it in the search preview before publishing. A Signal Weights action swaps the entire scoring model for matched queries, so result membership and facet counts can shift, not just the ordering.
Engagement 20% → 5%).
Add a Spread Results action
A Spread Results action caps how many products from the same group can appear near the top of results for the queries this rule matches. Use it when a query returns page after page of near-identical products, for example one shoe style in eight colors crowding out every other style.- In the actions section of a manual rule, click Add action and select Spread Results.
- Under Group by, choose what counts as a group:
- Product family — Spread results across your product families. Requires at least one active product family; without families, the cap has no effect.
- Attribute — Spread results across the values of a categorical attribute you pick, such as product type or vendor.
- Configure the limits:
- Window size — How many top positions the cap applies to (default 20). Beyond that window, natural ordering resumes and repeats are allowed.
- Max per group — The maximum number of products from one group allowed inside the window (default 2).
- Group coverage — A coverage floor. If fewer than this many distinct groups appear in the window, Layers promotes top-scoring products from missing groups to fill the gap (default 0, off).
- Click Save Changes to save the rule as a draft, or click Publish to apply it to live searches.
Set default selected options
Add the Default Selected Options action to choose the option values Layers prefers when selecting a product’s default variant for searches that match the rule. This action affects search only, not browse requests. For each option, choose Fixed value or Changes by month and set the corresponding value or monthly values. Layers uses the current month in your store’s timezone. If a month’s value is blank, Layers skips that option for that month. If the request already has non-empty default options, the action preserves them unless you enable Override shopper-provided defaults. With the override enabled, the action replaces the complete list of default options rather than merging with it. The Default Selected Options action changes presentation only. It does not filter products or remove variant-breakout tiles. Pinned variants and variants that match the query or keyword signals take priority over these defaults. A configured default takes priority over a clear semantic match to a variant; position is the final fallback.Choose a supported filter property
Promote and demote rules can use supported variant attributes as well as product attributes. A product matches a variant condition when an eligible shopper-visible variant meets it. For example, a negative condition such as price not equal to 20 matches only when none of the shopper-visible variants has a price of 20. Not every variant field is supported; pickup location name fields are not. A variant condition determines which products match the action, not which variant appears on the result tile.Manage existing rules
From Relevancy → Ranking Rules, you can:- Publish or unpublish a rule from the edit page using the Publish / Unpublish button. Unpublishing takes the rule offline without deleting it so you can republish it later.
- Edit a rule to change its conditions or actions. Rename the rule by clicking its name in the page header.
- Duplicate a rule from its edit page (Duplicate Rule) to create a copy with the same configuration.
- Delete a rule permanently.
”No effect” badge
The rules table shows a red No effect badge next to any rule that cannot influence ranking. Hover the badge to see the reason. Layers flags a rule for one of three reasons:- Unsupported filter property. The rule uses a property that ranking cannot evaluate, such as a pickup location name field. Edit the rule and choose a supported property in the Attribute picker.
- Full-catalog coverage. An All searches rule that promotes or demotes products matching nearly the entire catalog (95% or more) moves every product by the same amount. It cannot reorder results. Narrow the filter to target a specific subset of products, or change the scope to Matching searches.
- Zero catalog coverage. The rule’s filter matches no products in the catalog on the selected property. This usually means the value was mistyped or refers to a raw member that is now inside a facet value group. Pick the group by name instead, or edit the rule and confirm the property and value.
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 promoting in-stock products or demoting discontinued items across all searches.
- Use sort actions for intent-driven queries where customers expect a specific ordering. For example, sort 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 manual rule’s Before and After preview to compare unsaved actions. Use Test text search to check published rules in the search workflow.
- Use the draft state to stage and review rule changes before they affect customers. Save changes, verify behavior in the search preview, and publish only when you are confident.
Troubleshooting
- My new rule isn’t affecting search results. New rules are created as drafts by default. Open the rule and click Publish to apply it to live searches.
- I clicked Save Changes but the rule still appears inactive on the list. Save Changes only saves the current configuration. It does not change the published state. Click Publish from the edit page to activate the rule.
- I need to temporarily disable a live rule. Open the rule and click Unpublish. The rule keeps its configuration but stops running on live searches until you publish it again.
Next steps
- Ranking relevancy — How signal groups and ranking rules work
- Tune signal weights
- Test text search