> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rules

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

Rules affect the order in which products appear in your search results.
Rules let you pin, boost, bury, and block specific items in your catalog.
You can also use rules to display custom banners, redirect customers to a different page on your site, set facets, and more.

<LwTemplate />

<Card title="Every rule in Commerce Studio" href="https://academy.lucidworks.com/paths/019cbff3-cf91-7ee8-a1e0-ea69743d60d1" cta="View course" icon="graduation-cap">
  Learn how to use every rule type in Commerce Studio to improve search results and merchandising. This course provides detailed guidance on boost, pin, bury, block, facets, banners, redirects, and advanced configurations.
</Card>

Click your organization type to see examples of how to use rules to benefit your business goals:

<Tabs>
  <Tab title="Business-to-Consumer" icon="cart-shopping" iconType="sharp-solid">
    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

    For example, a boost rule could be applied to promote summer sandals and clothing for an end-of-summer promotion.
  </Tab>

  <Tab title="Business-to-Business" icon="briefcase" iconType="sharp-solid">
    B2B organizations use rules to promote the most relevant items, services, and documents based on customer queries, and provide similar products and specifications based on customer intent. For example, if your organization sells computer memory components to distributors, the results include installation instructions and specifications that distributors can confirm and provide to their customers.
  </Tab>

  <Tab title="Knowledge Management" icon="lightbulb" iconType="sharp-solid">
    Knowledge management organizations use rules to retrieve and display the most relevant documents based on user queries. For example, an organization that provides scientific study results for medication clinical trials may pin the most recent results, while burying results for previous studies.
  </Tab>
</Tabs>

## 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](/docs/lw-platform/lw-cs/cstudio-query-rewrite) screen, you will see the effects of those rules on the Editor screen.

## How rules work

Rules contain [conditions](#conditions) and [actions](#actions).
When a condition or a combination of conditions is met, the rule performs an action.

<iframe src="https://app.supademo.com/embed/cmjbjm2n735l5f6zphiikghdb?embed_v=2&utm_source=embed" loading="lazy" title="Commerce Studio Rules" allow="clipboard-write" frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen />

## Conditions

You can trigger rules on a single condition or a combination of conditions.

<ParamField body="Dates" type="string">
  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`.
</ParamField>

<ParamField body="Field Value" type="string">
  The field value to which the rule applies. For example, you can specify the `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.
</ParamField>

<ParamField body="Query" type="string">
  The query that triggers the rule. You must select a **Query Matching Method** to determine when a rule triggers.

  * **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."
</ParamField>

<ParamField body="Query Profile" type="string">
  Trigger this rule on a specified query profile. This value must match an existing Fusion query profile, which points to a specific configuration.
</ParamField>

<Accordion title="Query matching methods" icon="magnifying-glass">
  You must select a **Query Matching Method** to determine when a rule triggers:

  * **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".
</Accordion>

## 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

<Frame caption="Boost, pin, bury">
  <img src="https://mintcdn.com/lucidworks/84hgHnpjc8xFMsfB/assets/images/lw-platform/commerce-studio/actions/boost-pin-bury.png?fit=max&auto=format&n=84hgHnpjc8xFMsfB&q=85&s=76fc294cc59202f8704ae6661c6b6f0c" alt="Boost action" width="998" height="410" data-path="assets/images/lw-platform/commerce-studio/actions/boost-pin-bury.png" />
</Frame>

#### <Icon icon="rocket" /> Boost

Increases the ranking of one or more products so they move up in the search results.

##### Boost by attributes

<Frame caption="Boost by color blue">
  <img src="https://mintcdn.com/lucidworks/84hgHnpjc8xFMsfB/assets/images/lw-platform/commerce-studio/actions/attributes-slider.png?fit=max&auto=format&n=84hgHnpjc8xFMsfB&q=85&s=a3cc09e66c24f2aca98eeb248085a712" alt="Boost slider" width="451" height="244" data-path="assets/images/lw-platform/commerce-studio/actions/attributes-slider.png" />
</Frame>

Boosts items matching on selected attributes up in the search results based on the weight of the slider selection. This is the recommended type of boost because it adapts to changing catalogs and reflects a broader merchandising strategy.

You can boost 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 boosted.
* **Across multiple attributes**: You can combine different attribute categories using **AND logic** for more granular targeting. For example, if you set `Color: Black, Gray` AND `Count: 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.

<Note>
  Existing attribute rules continue to use OR logic between attributes, ensuring backward compatibility for older rules.
</Note>

This rule type also supports these comparison operators for numerical fields:

* **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.

<Note>
  Numeric comparison operators and boosting by AND attributes require Fusion 5.17.1 or later.
</Note>

##### 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.

#### <Icon icon="thumbtack" /> 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.

<Note>
  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.
</Note>

#### <Icon icon="arrow-down-short-wide" /> 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

<Frame caption="Bury by brand">
  <img src="https://mintcdn.com/lucidworks/84hgHnpjc8xFMsfB/assets/images/lw-platform/commerce-studio/actions/attributes-slider-2.png?fit=max&auto=format&n=84hgHnpjc8xFMsfB&q=85&s=246d4781fdb1ec39d11b7fbdf5cdfa05" alt="Boost slider" width="451" height="234" data-path="assets/images/lw-platform/commerce-studio/actions/attributes-slider-2.png" />
</Frame>

Buries items matching on selected attributes lower in the search results based on the weight of the slider selection. 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.

You can bury 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 buried.
* **Across multiple attributes**: You can combine different attribute categories using **AND logic** for more granular targeting. For example, if you set `Color: Black, Gray` AND `Count: 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.

<Note>
  Existing attribute rules continue to use OR logic between attributes, ensuring backward compatibility for older rules.
</Note>

This rule type also supports these comparison operators for numerical fields:

* **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.

<Note>
  Numeric comparison operators and burying by AND attributes require Fusion 5.17.1 or later.
</Note>

##### 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.

#### <Icon icon="ban" /> 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, Gray` AND `Count: 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.

<Note>
  Existing attribute rules continue to use OR logic between attributes, ensuring backward compatibility for older rules.
</Note>

This rule type also supports these comparison operators for numerical fields:

* **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.

<Note>
  Numeric comparison operators and blocking by AND attributes require Fusion 5.17.1 or later.
</Note>

##### Block items

Applies block to specific products that must be identified individually. These products will be completely removed from search results.

### Facets

#### <Icon icon="grid" /> 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.

<Accordion title="Advanced configuration options" icon="toolbox">
  <ParamField body="Type" type="enum" default="Term" required>
    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.
  </ParamField>

  <ParamField body="Value Selection" type="enum" default="Multi-select" required>
    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.
  </ParamField>

  <ParamField body="Value Order" type="enum" default="Count" required>
    Determines how facet values are sorted. **Index** sorts values in alphabetical or numeric order. **Count** sorts values by the number of matching products.
  </ParamField>

  <ParamField body="Minimum Count" type="integer" default="1" required>
    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.
  </ParamField>

  <ParamField body="Boost Values" type="array">
    Promotes specific facet values higher in the list, making them appear more prominently to users.
  </ParamField>

  <ParamField body="Bury Values" type="array">
    Moves specific facet values lower in the list, de-emphasizing them without removing them entirely.
  </ParamField>

  <ParamField body="Block Values" type="array">
    Removes specific facet values from display entirely, preventing them from appearing in the facet list.
  </ParamField>
</Accordion>

### Advanced

#### <Icon icon="image" /> 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.

<ParamField body="Banner URL" type="string" required>
  The URL of the image to display as a banner.
</ParamField>

<ParamField body="Banner Zone" type="string">
  An identifier specifying which zone or area of the page the banner should appear in.
</ParamField>

<Accordion title="Response JSON example" icon="brackets-curly">
  ```json theme={"dark"}
  "banner": [{
    "url": "https://example.com/assets/holiday-banner.png",
    "zone": "top-wide"
  }]
  ```
</Accordion>

#### <Icon icon="filter" /> Filter items

Applies [filter queries](https://solr.apache.org/guide/common-query-parameters.html) (`fq`) to the query and changes the results so a pre-selected set of content displays.

#### <Icon icon="code" /> 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.

<ParamField body="Blob type" type="string">
  An optional identifier used primarily for categorizing or identifying the blob.
</ParamField>

<ParamField body="JSON blob" type="string" required>
  The custom JSON blob to include in the search results response.
</ParamField>

<Accordion title="Response JSON example" icon="brackets-curly">
  ```json theme={"dark"}
  "jsonBlob": {
    "example-blob": [{
      "event": "Black Friday Sale 2026",
      "startDate": "11/27/2026 00:00",
      "endDate": "11/27/2026 23:59",
      "description": "Our biggest sale of the year! Save up to 70% on select items during our Black Friday event.",
      "banner": {
        "url": "https://example.com/assets/black-friday-2026-banner.png",
        "zone": "top-wide"
      },
      "promotionCode": "BF2026"
    }]
  },
  ```
</Accordion>

#### <Icon icon="arrow-right-arrow-left" /> 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.

<ParamField body="Path or URL" type="string" required>
  The URL or path to redirect users to.
</ParamField>

<Accordion title="Response JSON example" icon="brackets-curly">
  ```json theme={"dark"}
  "redirect": ["https://example.com/new-location"]
  ```
</Accordion>

#### <Icon icon="reply" /> 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.

#### <Icon icon="sliders" /> Set parameters

Sets a [parameter name and value](https://solr.apache.org/guide/solr/latest/query-guide/common-query-parameters.html) 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](/docs/lw-platform/lw-cs/cstudio-settings#variants) 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:

<ParamField body="expand.rows" type="number" required>
  Controls how many variants to display per group.
</ParamField>

<ParamField body="expand" type="boolean" required>
  Must be set to `true` to enable expansion.
</ParamField>

<ParamField body="fq" type="string" required>
  Contains the Solr `collapse` syntax that defines the grouping field.
</ParamField>

Here's an example of the syntax for the `fq` parameter:

```
{!collapse tag=collapse field=FIELD_NAME nullPolicy=expand}
```

It includes the following parameters:

<ParamField body="tag" type="string" required>
  This must be set to `collapse`.
</ParamField>

<ParamField body="field" type="string" required>
  The field to group by (for example, `id`, `color_s`, `product_family_s`).
</ParamField>

<ParamField body="nullPolicy" type="string" required>
  Determines behavior for items without a value in the grouping field (typically `expand`).
</ParamField>

### Example configurations

These example configurations illustrate how to configure advanced grouping for different scenarios:

<Tabs>
  <Tab title="Group by product ID">
    ```
    {!collapse tag=collapse field=id nullPolicy=expand}
    ```
  </Tab>

  <Tab title="Group by color">
    ```
    {!collapse tag=collapse field=color_s nullPolicy=expand}
    ```
  </Tab>

  <Tab title="Group by custom field">
    ```
    {!collapse tag=collapse field=Collapse_Field_s nullPolicy=expand}
    ```
  </Tab>
</Tabs>

## 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](/docs/lw-platform/lw-cs/cstudio-editor). Use this approach when you want to see how a rule affects item ranking in context as you configure it.

<iframe src="https://app.supademo.com/embed/cmjd7f1gn01s64e35foztaypg?embed_v=2&utm_source=embed" loading="lazy" title="Create a rule in Commerce Studio Editor" allow="clipboard-write" frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen style={{  width: '100%', height: '500px' }} />

<Note>
  More information about creating rules in the Editor, including options to create rules for individual items, is in the [Commerce Studio Editor](/docs/lw-platform/lw-cs/cstudio-editor) topic.
</Note>

### 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.

<Frame caption="Form Builder in Commerce Studio">
  <img src="https://mintcdn.com/lucidworks/_z7l9V_pCHLvnE6X/assets/images/lw-platform/commerce-studio/manual-builder.png?fit=max&auto=format&n=_z7l9V_pCHLvnE6X&q=85&s=0124cce5a07c4d09382b5067091a1516" alt="Form Builder" width="2048" height="1036" data-path="assets/images/lw-platform/commerce-studio/manual-builder.png" />
</Frame>

To create a rule using the Form Builder:

<Steps>
  <Step title="Open the Form Builder">
    On the Rules screen, click **Create Rule** and select **Form Builder**.
  </Step>

  <Step title="Configure the rule fields">
    Configure the rule fields in the panel that appears.

    <Accordion title="Configuration options">
      <ParamField body="Name" type="string" required>
        A name for the rule. You can edit this at any time.
      </ParamField>

      <ParamField body="Precedence" type="integer" required>
        Determines the order in which rules are applied when multiple rules match the same conditions. Lower numbers take higher priority.
      </ParamField>

      <ParamField body="Conditions" type="object" required>
        The conditions that trigger the rule. These correspond to the condition types described in [Conditions](#conditions).
      </ParamField>

      <ParamField body="Action" type="enum" required>
        The action the rule performs when its conditions are met. Select an action type from the dropdown. The form updates to show the configuration fields for that action type. For details on each action type, see [Actions](#actions).
      </ParamField>

      <ParamField body="Description" type="string">
        Optional text describing the purpose of the rule.
      </ParamField>
    </Accordion>
  </Step>

  <Step title="Save or publish the rule">
    Click **Save as Draft** to save the rule without publishing it, or click **Publish** to make it immediately active on your site.

    To edit a rule that is already published, see [Edit a published rule](#edit-a-published-rule).
  </Step>
</Steps>

## Manage rules

The Rules screen lists all rules in your Commerce Studio instance 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.

<Note>
  A published rule can have only one draft edit at a time. If a draft already exists, opening the rule for editing adds to the existing draft.
</Note>

### 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.

On the **draft row**:

* **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 you apply affects the published rule, the draft, or both, depending on the action.

For bulk operations that modify rules, you can choose to publish the changes immediately or save them as drafts attached to the affected rules.

## 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

This section provides examples of how to use rules to improve search results.

<Tabs>
  <Tab title="Ecommerce">
    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.

    * **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 Banner` rule to display a promotional banner when users search for mystery titles.
  </Tab>

  <Tab title="Knowledge management">
    B2B, B2C, and Knowledge management organizations can use rules to improve user search experiences for documents on their site by performing the following actions.

    For example, organizations could set rules to enhance the discovery of internal policies and procedures for employees, and different rules for searches about external, customer-facing policies, procedures, and product specifications.

    These examples describe some actions that can be applied to knowledge and support content to reduce friction and guide users quickly.

    * **Surface critical content.** Pin a gift card information document to the top of results for searches including the term, "gift".

    * **Guide users to key destinations.** Redirect users to a "Contact Us" page when they search for terms such as "email" or "contact".

    * **Target support documentation.** Use "\[ends with] manual" to boost user manuals and product documentation, or use "\[ends with] pdf" to prioritize downloadable resources.

    * **De-emphasize outdated content.** Bury notices related to discontinued programs so they appear lower in results.

    * **Prioritize important documents.** Redirect to the privacy policy page when a user searches for "privacy policy".

    * **Manage grouped content visibility.** Bury older product support documents within a group while pinning new program information to the top for related searches.
  </Tab>
</Tabs>
