Every rule in Commerce Studio
- Business-to-Consumer
- Business-to-Business
- Knowledge Management
- Products for marketing campaigns
- New product launches
- Products with inventory levels the organization wants to reduce
- Any other business objective, such as increasing conversions
Rules vs. query rewrites
Both rules and query rewrites can be configured to help return the best search results to your users. Query rewrites allow you to alter and interpret search terms in multiple ways so relevant results are delivered. Rules changes the order in which search results are displayed, allowing you to promote certain items over others. Although query rewrites are configured in the Rewrites screen, you will see the effects of those rules on the Editor screen.How rules work
Rules contain conditions and actions. When a condition or a combination of conditions is met, the rule performs an action.Conditions
You can trigger rules on a single condition or a combination of conditions.05/15/2026 12:00.Color field and set it to Color: Black. and multiple values for a given field to create more specific rules. For example, if you set the Color field to Color: Black and specify the Brand field to include multiple brands, then the rule triggers only if the Color and Brand field conditions are satisfied.- is: The search query must match the defined term exactly. For example, if the rule is set to “[is] black shoes”, it only triggers when the user search is exactly “black shoes.”
- contains: The search query must include one or more of the defined terms anywhere within the query. Each word is evaluated independently. For example, if the rule is set to “[contains] black shoes”, it triggers for any query containing “black” (such as “black boots”) and any query containing “shoes” (such as “running shoes”). The words do not need to appear together or in a specific order.
- contains phrase: The search query must include the defined phrase in the exact word order entered. For example, if the rule is set to “[contains phrase] black shoes”, it triggers for “black shoes” or “men’s black shoes,” but not for “shoes black” or “black running shoes.”
- starts with: The search query must begin with the defined word or phrase. For example, if the rule is set to “[starts with] winter”, it triggers for “winter jackets” or “winter boots,” but not for “jackets for winter.” Multi-word phrases respect word order, so “[starts with] winter jackets” triggers for “winter jackets sale” but not for “jackets winter sale.”
- ends with: The search query must end with the defined word or phrase. For example, if the rule is set to “[ends with] manual”, it triggers for “installation manual” or “product manual,” but not for “manual installation guide.” Multi-word phrases respect word order, so “[ends with] near me” triggers for “pizza near me” but not for “near pizza me.”
Query matching methods
Query matching methods
- is: The search query must match the defined term exactly. For example, if the rule is set to “[is] black shoes”, it only triggers when the user search is exactly “black shoes”.
- contains: The search query must include one or more of the defined terms anywhere within the query. Each word is evaluated independently. For example, if the rule is set to “[contains] black shoes”, it triggers for any query containing “black” (such as “black boots”) and any query containing “shoes” (such as “running shoes”). The words do not need to appear together or in a specific order.
- contains phrase: The search query must include the defined phrase in the exact word order entered. For example, if the rule is set to “[contains phrase] black shoes”, it triggers for “black shoes” or “mens black shoes,” but not for “shoes black” or “black running shoes”.
- starts with: The search query must begin with the defined word or phrase. For example, if the rule is set to “[starts with] winter”, it triggers for “winter jackets” or “winter boots,” but not for “jackets for winter”. Multi-word phrases respect word order, so “[starts with] winter jackets” triggers for “winter jackets sale” but not for “jackets winter sale”.
- ends with: The search query must end with the defined word or phrase. For example, if the rule is set to “[ends with] manual”, it triggers for “installation manual” or “product manual,” but not for “manual installation guide”. Multi-word phrases respect word order, so “[ends with] near me” triggers for “pizza near me” but not for “near pizza me”.
Commerce Studio: Starts With/ Ends With Rules
Actions
You can only apply one action per rule. Commerce Studio alerts you if you create multiple rules with conflicting actions. For example, a conflict occurs if you create rules that boost, block, and bury the same item.Rerank

Boost, pin, bury
Boost
Increases the ranking of one or more products so they move up in the search results.Boost by attributes
Boosts items in the search results that match selected attributes, based on the weight given the attribute in a slider. This is the recommended type of boost because it adapts to changing catalogs and reflects a broader merchandising strategy. This demo describes how to create a boost rule by specifying attributes in the Commerce Studio Rules screen (Form Builder).- Within a single attribute: When you select multiple values for one attribute (for example,
Color: Black, Gray), items matching any of those values are included using OR logic, so items matching either Black or Gray are boosted. - Across multiple attributes: You can combine different attribute categories using AND logic for more granular targeting. For example, if you set
Color: Black, GrayANDCount: 40, 50, the rule boosts only black or gray items that come in packs of 40 or 50. Items must match at least one value from each attribute category.
Boost Param examples
Boost Param examples
- Equals matches the specified value exactly (text or numeric).
- Greater than matches numeric values greater than the specified number.
- Less than matches numeric values less than the specified number.
- Greater than or equal to matches numeric values greater than or equal to the specified number.
- Less than or equal to matches numeric values less than or equal to the specified number.
- Between matches numeric values within the specified range (inclusive).
- Not equal to excludes values that match the specified value exactly.
Boost items
Boosts specific items to the top of the results. These items must be identified individually. This approach is more precise but less flexible than boost by attributes.Pin items
Pins products to an exact location within search results. This allows precise control over product placement. For example, you can ensure certain products always appear next to each other.Bury
Moves selected items to the bottom of search results. Unlike the Block action, products are not removed entirely from the search results.Bury by attributes
Buries items in the search results that match selected attributes, based on the weight given the attribute in a slider. This is the recommended type of bury for the same reasons as boost by attributes. For example, you can use this to de-emphasize a particular brand in your results without removing it entirely.- Within a single attribute: When you select multiple values for one attribute (for example,
Color: Black, Gray), items matching any of those values are included using OR logic, so items matching either Black or Gray are buried. - Across multiple attributes: You can combine different attribute categories using AND logic for more granular targeting. For example, if you set
Color: Black, GrayANDCount: 40, 50, the rule buries only black or gray items that come in packs of 40 or 50. Items must match at least one value from each attribute category.
- Equals matches the specified value exactly (text or numeric).
- Greater than matches numeric values greater than the specified number.
- Less than matches numeric values less than the specified number.
- Greater than or equal to matches numeric values greater than or equal to the specified number.
- Less than or equal to matches numeric values less than or equal to the specified number.
- Between matches numeric values within the specified range (inclusive).
- Not equal to excludes values that match the specified value exactly.
Bury items
Buries specific items to the bottom of the results. These items must be identified individually. Like boost items, this approach is more precise but less flexible than bury by attributes.Block
Removes selected items from search results entirely. Blocked items don’t appear for matching searches.Block by attributes
Applies block based on selected attributes. Products matching the specified attributes are completely removed from search results. You can block items based on multiple attributes, including multiple values in one category.- Within a single attribute: When you select multiple values for one attribute (for example,
Color: Black, Gray), items matching any of those values are included using OR logic, so items matching either Black or Gray are blocked. - Across multiple attributes: You can combine different attribute categories using AND logic for more granular targeting. For example, if you set
Color: Black, GrayANDCount: 40, 50, the rule blocks only black or gray items that come in packs of 40 or 50. Items must match at least one value from each attribute category.
- Equals matches the specified value exactly (text or numeric).
- Greater than matches numeric values greater than the specified number.
- Less than matches numeric values less than the specified number.
- Greater than or equal to matches numeric values greater than or equal to the specified number.
- Less than or equal to matches numeric values less than or equal to the specified number.
- Between matches numeric values within the specified range (inclusive).
- Not equal to excludes values that match the specified value exactly.
Block items
Applies block to specific products that must be identified individually. These products will be completely removed from search results.Facets
Manage facets
Customizes which facet categories appear in the query response, their display order, and their individual configuration settings. For example, if your site sells clothing, you can configure facet categories for brand, color, price, size, and other attributes. Each facet category can be extensively customized to control how values are displayed and how users interact with them.Advanced configuration options
Advanced configuration options
Advanced
Add banner
Associates an image URL with a search rule and includes it in the search results JSON response. You can specify the image URL and optionally define a page zone identifier. Your frontend application can then consume this data to dynamically display promotional banners or images alongside the corresponding search results.Response JSON example
Response JSON example
Filter items
Applies filter queries (fq) to the query and changes the results so a pre-selected set of content displays.
Set JSON configuration
Allows you to define a custom JSON blob that will be included in the search results response. You can input any valid JSON structure, which your frontend application can then interpret and use for custom functionality. This provides flexibility to pass arbitrary data alongside search results for frontend consumption.Response JSON example
Response JSON example
Redirect
Includes a redirect URL in the search results JSON response. Your frontend application can consume this data to redirect users to a specific destination, such as dedicated landing pages or custom pages for queries that return zero results.Response JSON example
Response JSON example
Set response value
Sends an arbitrary value to the frontend or pipeline to trigger another action. This action can be combined with other actions within the same rule. For example, an e-commerce website may use the response value action to display an advertisement.Set parameters
Sets a parameter name and value to a search query. For example, the sort order for the results, or a filter that affects results.Advanced Grouping
Advanced grouping is a conditional, rule-based approach to product variant grouping that enables different grouping behaviors based on rules. You can implement advanced grouping using the Set Parameters rule type. When you create a Set Parameters rule that includes the required grouping parameters, Commerce Studio automatically detects and enables grouping for queries where the rule conditions are met. This conditional behavior means grouping can activate for some searches but not others, based on your rule configuration. Advanced grouping enables scenarios like these:- Apply color-based grouping for apparel queries but ID-based grouping for electronics
- Group by size for furniture searches but by style for home decor
- Enable grouping only for specific categories or query types
- Switch grouping fields based on seasonal campaigns or promotions
Enable advanced grouping
To enable advanced grouping, your Set Parameters rule must include the following:true to enable expansion.collapse syntax that defines the grouping field.fq parameter:
collapse.id, color_s, product_family_s).expand).Example configurations
These example configurations illustrate how to configure advanced grouping for different scenarios:- Group by product ID
- Group by color
- Group by custom field
Create rules
Commerce Studio offers two ways to create rules: the Visual Builder and the Form Builder.Visual Builder
The Visual Builder lets you create rules while previewing live search results in the Editor. Use this approach when you want to see how a rule affects item ranking in context as you configure it.Form Builder
The Form Builder lets you create rules directly on the Rules screen without the live preview. Use this approach when you know exactly what rule you want to create and do not need to see the search results in context.
Form Builder in Commerce Studio
Open the Form Builder
Configure the rule fields
Configuration options
Configuration options
Save or publish the rule
Manage rules
The Rules screen lists all rules in your Commerce Studio environment and is where you publish, edit, filter, and perform bulk actions on them.Rule states
Each rule on the Rules screen is in one of the following states:- Published. The rule is active on your site.
- Draft. The rule is saved but is not active on your site.
- Published with draft edits. A published rule has unpublished edits saved as a draft. The published version remains active on your site, and the draft appears as a second row beneath it so you can see and act on both.
Edit a published rule
When you edit a published rule, the published version continues to serve your site until you explicitly publish the changes. Your edits are shown in the Editor as a draft so you can preview their impact without affecting customers. When you finish editing, click Publish to replace the published version with your edits and apply them to your site immediately. Alternatively, click Save as Draft to save your edits as a draft attached to the published rule. The published version remains live, and the draft appears beneath it on the Rules screen.Manage a published rule with draft edits
When a published rule has draft edits, both versions appear as two rows on the Rules screen. The actions available depend on which row you act on. On the published row:- Edit is disabled. Edits must be made to the draft version.
- Delete removes both the published rule and the draft edits.
- Duplicate is disabled. The draft edits must be published or deleted before the rule can be duplicated.
- Unpublish unpublishes the rule and deletes the draft edits.
- Edit opens the draft for further editing.
- Delete discards the draft and restores the rule to the published version.
- Publish replaces the published version with the draft and applies it to your site.
Bulk actions
When you select multiple rules from the Rules screen, the bulk action options let you update all of the selected rules at one time. Watch this demo to learn how to select multiple Commerce Studio rules and update them all at once.Publish multiple rules
Publish multiple rules
- After you select the rules to publish, click Publish from the bulk action option bar. The confirmation window displays, and indicates any rules that conflict with the rules you want to publish.

Publish multiple rules
- To proceed, click Publish.
Unpublish multiple rules
Unpublish multiple rules
- After you select the rules to unpublish, click Unpublish from the bulk action option bar. The confirmation window displays and indicates the number of rules to unpublish.

Unpublish multiple rules
- To proceed, click Unpublish.
Edit multiple rules
Edit multiple rules
- After you select the rules to modify, click Edit from the bulk action option bar.

Edit multiple rules
- Click the Tags field to select from the list. If you click + you can add another tag.
- Click the Query Profiles field to select from the list. If you click +, you can add another query profile.
- Select either Save as Draft or Publish changes for the rules you are editing.
- Click Apply to save the changes to the selected rules.
Migrate multiple rules to a different Commerce Studio environment
Migrate multiple rules to a different Commerce Studio environment
- After you select the rules you want to migrate from one Commerce Studio environment to a different Commerce Studio environment, click Migrate from the bulk action option bar.

Migrate multiple rules to a different Commerce Studio environment
- Click the Target Environment field to select from the list.
- Select either to migrate the selected rules and designate the rules with the Draft or Published status.
- Click Migrate to complete the migration of those rules.
- Access the target Commerce Studio environment and verify the rules migrated correctly.
Export multiple rules to a CSV file
Export multiple rules to a CSV file
Delete multiple rules
Delete multiple rules
Deselect the rules currently selected
Deselect the rules currently selected
Examples to improve search results using rules
Commerce Studio allows you to apply targeted actions when a search query contains specific terms. These actions do not require code changes and support the following business goals to:- Improve relevance
- Guide users to the content they are seeking
- Ecommerce
- Knowledge management
- Promote high-priority products. Boost books from a popular series so they appear higher in search results when users search by author name.
- Remove outdated or unavailable items. Block discontinued titles to ensure only relevant, purchasable books appear in results.
- Highlight specific products. Boost selected new or overstocked titles to increase visibility and drive sales.
- Refine results by intent. Filter results to show only children’s and young adult books when users search for children’s content.
- Improve ranking within related groups. Boost items within a series so the most popular titles appear first when users search for that series.
- Target branded searches. Use “[starts with]” to boost promotional campaigns when users begin their query with a specific brand name, without affecting queries where the brand appears later in the query.
- Support location-based queries. Use “[ends with] near me” to apply location-specific filtering or boosting logic for geo-modified searches.
- Manage available facets. Display genre facets on the homepage and top author facets on search results pages to help users refine results.
-
Apply advanced configurations. Use a
Set Bannerrule to display a promotional banner when users search for mystery titles.