Search Rules
Search Rules define merchandising behaviour inside a search rule group. Each rule matches shopper queries using a trigger and applies actions when the trigger fires.
Triggers
match | Behaviour |
|---|---|
exact | Normalized query must equal the trigger query (default) |
contains | Trigger query must appear as a substring in the normalized query |
Query text is normalized (trimmed, lowercased, whitespace collapsed) before matching.
Actions
boosts:{ condition, weight }pairs using standard filter syntax. Positive weights boost; negative weights bury.pins: product IDs at global one-based result positions. Active filters still apply.hides: product IDs removed from results; hide beats pin for the same product.replace_query: one non-empty replacement query. The first rewrite wins and rule matching runs once more on the replacement.filter_by: one validated expression ANDed with profile and shopper filters.
Rule evaluation
- Rules are evaluated in one profile-wide pipeline: profile
rule_groupsarray order, then ruleexecution_order. - Set
stop_after_match: trueto skip later rules, including rules in later attached groups. execution_ordermust be unique within a group.
Example workflow
Create a group drill-boost, add an exact rule on query drill that boosts extensions.products(Details).BRAND-NAME:=Milwaukee by 100, then attach the group to a search profile's rule_groups array.
📄️ Create search rule
Create a search rule in the given rule group. Each rule requires a unique `execution_order` within the group.
📄️ List search rules
List rules in a search rule group, ordered by `execution_order`, with offset/limit pagination.
📄️ Get search rule
Get a search rule by ID within a rule group.
📄️ Update search rule
Update one or more attributes of a rule in its current group. A successful update takes effect for subsequent searches.
📄️ Delete search rule
Delete a search rule by ID within a rule group. Deleting a rule is allowed even when the parent group is attached to a search profile.
📄️ Move search rule
Move a rule within its current group before or after another rule, or to the first or last position. The service preserves sparse execution order values and resequences the group when no integer gap remains.