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. Click your organization type to see examples of how to use rules to benefit your business goals:- Business-to-Consumer
- Business-to-Business
- Knowledge Management
B2C organizations use rules to promote the following to achieve business goals:
- Products for marketing campaigns
- New product launches
- Products with inventory levels the organization wants to reduce
- Any other business objective, such as increasing conversions
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.| Type | Description | Notes |
|---|---|---|
| Dates | The date and time range for the rule. | Click the field to select a date and time, or enter manually. For example, 05/15/2026 12:00. |
| Field Value | The field value to which the rule applies. For example, you can specify the Color field and set it to Color: Black. | You can add multiple fields. |
| Query | The query that triggers the rule. | You must select a Query Matching Method to determine when a rule triggers. ● For the option 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.” ● For the option 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. ● For the option 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.” |
| Query Profile | Trigger this rule on a specified query profile. | This value must match an existing Fusion query profile, which points to a specific configuration. |
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
Increases the ranking of one or more products so they move up in the search results.Boost by attributes

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.Another example is that you can pin a product to a specific position that reliably appears on page 2 after pagination. This capability requires the applicable Fusion patch to be installed. For more information, contact your Lucidworks support representative.
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

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 will not appear for matching searches.Block by attributes
Applies block based on selected attributes. Products matching the specified attributes will be completely removed from search results.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
Specifies how facet values are generated. Term generates discrete values like brand names or colors. Gap Range generates numeric ranges like price brackets or size ranges.
Controls how users can select facet values. Single-select allows users to choose only one value at a time. Multi-select allows users to choose multiple values simultaneously.
Determines how facet values are sorted. Index sorts values in alphabetical or numeric order. Count sorts values by the number of matching products.
Sets the minimum number of matching products required for a facet value to be displayed. Values with fewer matches will be hidden from the facet list.
Promotes specific facet values higher in the list, making them appear more prominently to users.
Moves specific facet values lower in the list, de-emphasizing them without removing them entirely.
Removes specific facet values from display entirely, preventing them from appearing in the facet list.
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.The URL of the image to display as a banner.
An identifier specifying which zone or area of the page the banner should appear in.
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.An optional identifier used primarily for categorizing or identifying the blob.
The custom JSON blob to include in the search results response.
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.The URL or path to redirect users to.
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 ecommerce 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.Create rules
In addition to this demo, more information about the features of Commerce Studio Editor, including options to create rules for individual items, is detailed in the Commerce Studio Editor topic of the documentation.
Examples to improve search results using rules
Commerce Studio allows teams 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
B2B and B2C organizations can use rules to improve product discovery and merchandising outcomes by performing the following actions. These examples describe some actions for a bookstore website.
- 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.
- 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.