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

# Business Rules

> Overview

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>;
};

export const InlineImage = ({src, alt = '', height = '2em'}) => {
  return <img src={src} alt={alt} style={{
    display: 'inline',
    verticalAlign: 'start',
    height: height,
    margin: '0'
  }} />;
};

[localhost link]: http://localhost:3000/docs/5/fusion/getting-data-out/query-enhancement/business-rules/overview

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/getting-data-out/query-enhancement/business-rules/overview

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/8835

Business rules are manually-created formulas for rewriting queries. This is the most versatile strategy for creating custom query rewrites. It supports a variety of conditions and actions to address a wide range of use cases. When you need a very specific query rewrite, this is the best strategy.

Business rules are applied in the [Apply Rules stage](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/query-rules-query-stage) of the query pipeline.

To learn how to use business rules in the [Rules Editor](/docs/5/fusion/getting-data-out/query-enhancement/rules-editor), see **Use Business Rules in the Rules Editor**.

<Accordion title="Use Business Rules in the Rules Editor">
  This article describes how to use the [Business Rules](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/overview) screen in the [Rules Editor](/docs/5/fusion/getting-data-out/query-enhancement/rules-editor).

  <Card title="Query Rewriting with Business Rules and Search Rewrites" class="note-image" href="https://academy.lucidworks.com/query-rewriting-with-business-rules-and-search-rewrites" cta="Take this course on the LucidAcademy." icon="graduation-cap" iconType="duotone">
    The course for **Query Rewriting with Business Rules and Search Rewrites** focuses on how using business rules and search rewrites gives you the opportunity to boost conversions and create better customer experiences by improving your relevancy.
  </Card>

  <LwTemplate />

  ## Facet rules

  ### Facet menu

  <img src="https://mintcdn.com/lucidworks/L5PMnIeZ03zhv8Ti/assets/images/5.6/facet-menu.png?fit=max&auto=format&n=L5PMnIeZ03zhv8Ti&q=85&s=7a220e907feef17ff297b2e8879131ed" alt="Facet rules" width="2946" height="1468" data-path="assets/images/5.6/facet-menu.png" />

  To facet the rules list by **Action**, **Status**, **Published**, or **Tags**, click one of the facet items within the facet categories.

  To facet the rules list by **Created Date** or **Expiration Date**:

  1. Click the date start value. A calendar will appear.

       <img src="https://mintcdn.com/lucidworks/1FfsxYVDR4XL56q9/assets/images/5.1/ai-rules/rules-facets-date.png?fit=max&auto=format&n=1FfsxYVDR4XL56q9&q=85&s=8e2c03acba6766993d51cc815d830410" alt="Created date start value" style={{ width: "300px" }} width="440" height="344" data-path="assets/images/5.1/ai-rules/rules-facets-date.png" />

  2. Click a date to select the start of your facet range.

  3. Click the bottom date and select the end of your facet range.

  ### Search

  Enter a term in the search bar to quickly facet your business rules.

  ## Rules

  ### Create a rule

  1. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/add-button-1.png" alt="Add button large" /> button in the top-right corner of the card. Alternatively, click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/add-button-2.png" alt="Add button small" /> button in the bottom-left corner of the card. The **New Rule** dialog box will appear.

       <img src="https://mintcdn.com/lucidworks/1FfsxYVDR4XL56q9/assets/images/5.1/ai-rules/new-rule.png?fit=max&auto=format&n=1FfsxYVDR4XL56q9&q=85&s=37992007ed2233ee6cac599ce2eb6dac" alt="New rule" width="2560" height="1344" data-path="assets/images/5.1/ai-rules/new-rule.png" />
  2. Complete the required fields, at a minimum.

     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                                                                        |
     | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
     | General                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Condition                                                                                                                                                                                                                        | Action                                                                                                                                                                                                                                                                                                 |
     | In the **General** column, only the **Name** field is required. Other fields are optional: <ul><li>**Description** is an arbitrary string you can use to describe this rule.</li> <li>**Rule Group** can be a user-defined group that you use to organize your rules.</li>  <li>**Tags** are another way to organize your rules. Tags appear as facets in the Business Rules interface, so you can filter the set of visible rules by tag.</li> <li>**Priority** can be used to determine which rule should apply first if multiple rules are activated for the same request. Priority is an integer value, ranging from 1 to infinity, with the value 1 given lowest priority. If multiple rules have the same value, those rules are applied in a random order.</li> <li>**Enabled** means that this rule is applied but not necessarily published. Disabling a rule helps ensure that it is not accidentally published.</li></ul> | Conditions are triggers that activate the rule when they match the current date and time, query, or field values. See [Rule conditions](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) for more information. | A rule can take different types of actions when the specified conditions are met. See [Action types](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) for more information. You can also create [custom actions](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting). |

     <Tip>Hover over the <InlineImage src="/assets/images/5.1/ai-rules/icons/info-icon.png" alt="Info icon" /> icon for more information.</Tip>
  3. Once complete, click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/save-buttong.png" alt="Save button green" /> button.

  ### Copy a rule

  1. Hover over a rule. A row of buttons will appear on the right.
  2. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/copy-button.png" alt="Copy button" /> button. The **Copy Rule** dialog box will appear.

       <img src="https://mintcdn.com/lucidworks/TTnHmbCCHl-1HFoG/assets/images/5.1/ai-rules/copy-rule.png?fit=max&auto=format&n=TTnHmbCCHl-1HFoG&q=85&s=7f1ec5c812c791b509154b2d24c1641d" alt="Copy rule" width="2560" height="1344" data-path="assets/images/5.1/ai-rules/copy-rule.png" />
  3. At a minimum, change the title of the rule.
  4. Once complete, click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/save-buttong.png" alt="Save button green" /> button.

  ### Edit a rule

  1. Hover over a rule. A row of buttons will appear on the right.
  2. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/edit-button.png" alt="Edit button" /> button. The **Edit Rule** dialog box appears.

       <img src="https://mintcdn.com/lucidworks/1FfsxYVDR4XL56q9/assets/images/5.1/ai-rules/edit-rule.png?fit=max&auto=format&n=1FfsxYVDR4XL56q9&q=85&s=0b22a2d898cf85092f6243e5f217d677" alt="Edit rule" width="2560" height="1344" data-path="assets/images/5.1/ai-rules/edit-rule.png" />
  3. Make your desired changes to the rule.
  4. Once complete, click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/save-buttong.png" alt="Save button green" /> button.

  ### Approve/deny rules

  1. Hover over a rule. A checkbox will appear on the left.
  2. Click the checkbox to select the rule.
  3. Repeat this process to select multiple rules. *(optional)*
  4. Click the Approve button to approve the selected rules, or click the Deny button to deny the rules.

  ### Enable/disable a rule

  1. Hover over a rule. A checkbox will appear on the left.
  2. Click the checkbox to select the rule.
  3. Repeat this process to select multiple rules. *(optional)*
  4. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/enable-button.png" alt="Enable button" /> button to enable the selected rules, or click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/disable-button.png" alt="Disable button" /> button to disable the rules.

  ### Publish a rule

  1. Hover over a rule. A checkbox will appear on the left.
  2. Click the checkbox to select the rule.
  3. Repeat this process to select multiple rules. *(optional)*
  4. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/publish-selected-button.png" alt="Publish selected button" />button to publish the selected rules.

  ### Tag a rule

  Tags are a powerful tool for organizing and publishing rules according to a keyword, such as `black-friday-sale`.

  1. Hover over a rule. A checkbox will appear on the left.
  2. Click the checkbox to select the rule.
  3. Repeat this process to select multiple rules. *(optional)*
  4. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/tag-button.png" alt="Tag button" /> button. A dialog box will appear.
  5. Enter a tag. To enter multiple tags, press **Tab** after writing each tag.
  6. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/add-button-1.png" alt="Add button large" />  button to add the tag to the rule.

       <Note>
         See [General Configuration Tags](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/general-config) for information about how to use tagnames in the request URL to fire specific rules.
       </Note>

  ### Delete rules

  #### Delete a single rule

  1. Hover over a rule. A row of buttons will appear on the right.
  2. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/delete-button-2.png" alt="Delete button small" /> button. A confirmation box will appear.
  3. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/delete-button-1g.png" alt="Delete button large green" /> button to confirm.

  #### Delete multiple rules

  1. Hover over a rule. A checkbox will appear on the left.
  2. Click the checkbox to select the rule.
  3. Repeat this process to select multiple rules. *(optional)*
  4. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/delete-button-1r.png" alt="Delete button large red" /> button to delete the selected rules. A confirmation box will appear.
  5. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/delete-button-1g.png" alt="Delete button large green" /> button to confirm.

  ### Sort rules

  1. Hover over column titles. A <InlineImage src="/assets/images/5.1/ai-rules/icons/arrow-down-icon.png" alt="Arrow down icon" /> icon will appear for some titles to indicate the rules list can be sorted by that column.
  2. Click on the title column to sort the rules.

  <Note>The column that is currently sorting the rules list is indicated by an <InlineImage src="/assets/images/5.1/ai-rules/icons/arrow-down-icon.png" alt="Arrow down icon" /> or <InlineImage src="/assets/images/5.1/ai-rules/icons/arrow-up-icon.png" alt="Arrow up icon" /> icon.</Note>

  ### Export rules

  To export the rules list, simply click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/export-button.png" alt="Export button" /> button. This generates a `.csv` file containing your rules.

  ## Columns

  ### Customize columns

  To customize the columns:

  1. Hover over the row of column titles. A <InlineImage src="/assets/images/5.1/ai-rules/buttons/config-button.png" alt="Config button" /> button will appear on the right.
  2. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/config-button.png" alt="Config button" /> button. The **Customize Columns to Display** dialog box will appear.

       <img src="https://mintcdn.com/lucidworks/TTnHmbCCHl-1HFoG/assets/images/5.1/ai-rules/customize-columns-br.png?fit=max&auto=format&n=TTnHmbCCHl-1HFoG&q=85&s=c835f109d3cb5d5a845a3f0a7166f9db" alt="Customize Columns to Display" width="1850" height="1085" data-path="assets/images/5.1/ai-rules/customize-columns-br.png" />
  3. Click the checkboxes to select or deselect the columns you want to display.
  4. Click the <InlineImage src="/assets/images/5.1/ai-rules/buttons/save-buttonb.png" alt="Save button blue" />  button to save your changes.
</Accordion>

## Configuration options

### General

General configurations are used to characterize a rule, including its name, description, group, and more. They are also used to set a rule’s precedence, or priority over other rules.

For complete details, see [General Configurations](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/general-config).

### Condition

Conditions, or triggers, define the environment necessary for the rule action to fire. Any combination of conditions (date, field value, query, and query profile) can be defined for a rule.

For complete details, see [Conditions](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/conditions).

### Action

Business rule actions define what actions are taken when a rule fires.

For complete details, see [Actions](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/actions).

## Custom Rule Actions

Custom rule actions allow you to define a unique action to take when certain conditions are met. They involve three primary components: a query pipeline, a custom rule type, and a rule that is triggered by conditions defined by the user.

For complete details, see [Custom Rule Actions](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/custom-rules-actions). To learn use custom rule actions with the API, see **Create Custom Rule Actions with the API**.

<Accordion title="Create Custom Rule Actions with the API">
  Custom rule actions allow you to define a unique action to take when certain conditions are met. They involve three primary components: a query pipeline, a custom rule type, and a rule that is triggered by conditions defined by the user.

  This article describes the general workflow for creating a custom rule action. The example assumes the following components are used:

  | Component        | Name                 |
  | ---------------- | -------------------- |
  | Query pipeline   | custom-rule-pipeline |
  | Custom rule type | custom-rule-type     |
  | Rule             | custom-rule-action   |

  1. Create a query pipeline, `custom-rule-pipeline`, that is used to complete the rule action.

  2. Create a custom rule type, `custom-rule-type`, that uses your query pipeline. Here are some important parameters to include in your `POST` request.

     <Note> Rule properties, included as part of the `schema</code`, define the values required from the user to create a rule that uses the custom rule type.</Note>

       <ParamField path="id" required>
         A unique ID for the custom rule type. The `id` value must be unique across all apps in Fusion (global namespace).\
         **Example:** `custom-rule-type`
       </ParamField>

       <ParamField path="pipeline_id" required>
         The ID of the pipeline that is invoked during rule processing.\
         **Example:** `custom-rule-pipeline`
       </ParamField>

       <ParamField path="display_type" required>
         A user-friendly name for the custom rule type.\
         **Example:** `My Custom Rule`
       </ParamField>

       <ParamField path="custom_param1" required>
         The ID of the rule’s parameter. This field is used in the API but is not visible in the Rules Editor.\
         **Example:** `1st-rule-parameter`
       </ParamField>

       <ParamField path="type" required>
         The type of user-input.\
         **Example:** `string`
       </ParamField>

       <ParamField path="title" required>
         A user-friendly name for the parameter.\
         **Example:** `Manufacturer`
       </ParamField>

       <ParamField path="description" required>
         A user-friendly description of what the field is used for. The `description` value is shown in the field’s tooltip in the Rules Editor.\
         **Example:** The manufacturer of the product to which this rule applies.
       </ParamField>

     For example:

     {/* // tag::custom-rules-example[] */}

     ```json theme={"dark"}
     curl -u USERNAME:PASSWORD -XPOST -H "Content-type:application/json" \
     https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/apps/myFusionApp/custom-rule-types -d '{
     "id":"custom-rule-type",
     "pipeline_id":"custom-rule-pipeline",
     "display_type":"My Custom Rule",
     "schema": {
         "type" : "object",
         "properties" : {
         "custom_param1" : {
             "type" : "string",
             "title" : "Manufacturer",
             "description" : "The manufacturer of the product this rule action applies to."
         },
         "custom_param2" : {
             "type": "string",
             "title": "Type",
             "description": "The type of product this rule action applies to."
         }
         }
     }
     }'
     ```

     {/* // end::custom-rules-example[] */}

  3. Verify the custom rule type was created by visiting `https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/apps/myFusionApp/custom-rule-types`. Custom rule types are also available in the Rules Editor:

       <img src="https://mintcdn.com/lucidworks/S4K1ej9-5L4WZcZ9/assets/images/5.2/custom-rules-ui.png?fit=max&auto=format&n=S4K1ej9-5L4WZcZ9&q=85&s=ead88a144bc49b3a4145dde23cd40c3e" alt="Custom Rule Type in the Rules Editor" width="1160" height="836" data-path="assets/images/5.2/custom-rules-ui.png" />

  4. Create a rule, `custom-rule-action`, that uses your custom rule, `custom-rule-type`. If you are creating the rule using the Query Rewrite API, the following image depicts which parameters are shared between the custom rule type and the rule:

       <img src="https://mintcdn.com/lucidworks/S4K1ej9-5L4WZcZ9/assets/images/5.2/custom-rules-api-breakdown.png?fit=max&auto=format&n=S4K1ej9-5L4WZcZ9&q=85&s=ca536dcd2c4b61d6135c3758a094294e" alt="Custom rule type and rule parameters" width="1012" height="556" data-path="assets/images/5.2/custom-rules-api-breakdown.png" />

     Note that the custom rule type `id` value is used for the rule’s `type` *and* `custom_type` fields. Remember to assign values to the custom rule properties, `custom_param1` and `custom_param2`.

     ```json theme={"dark"}
     curl -u USERNAME:PASSWORD -XPOST -H "Content-type:application/json" \
     https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/apps/myFusionApp/query-rewrite/instances -d '{
       "id":"123456",
       "type":"custom-rule-type",
       "custom_type":"custom-rule-type",
       "name":"My Rule",
       "description":"A rule that uses my custom rule, custom-rule-type.",
       "search_terms":["upcoming sale"],
       "custom_param1":"ABC",
       "custom_param2":"XYZ",
       "pipeline_id":"custom-rule-pipeline",
       "display_type":"My Custom Rule"
     }'
     ```

  5. Verify your rule was created by checking the rule ID, `123456`, with the Query Rewrite API: `https://EXAMPLE_COMPANY.b.lucidworks.cloud/api/apps/myFusionApp/query-rewrite/instances/123456`

  6. Test your custom rule using your normal rule development process.
</Accordion>

## Query Elevation Component

Fusion currently supports the use of the Query Elevation Component (QEC) with boost lists and filter lists. You must configure Solr in order to enable the QEC option.

For instructions about using the QEC, see **Use the Query Elevation Component**.

<Accordion title="Use the Query Elevation Component">
  Fusion currently supports the use of the Query Elevation Component (QEC) with boost lists and filter lists. You must configure Solr in order to enable the QEC option.

  <Note>Although it will not be accessed for the elevation process, Fusion requires an independent `elevate.xml` file for the use of built-in rule actions with QEC due to a known [issue in Solr](https://issues.apache.org/jira/browse/SOLR-14970).</Note>

  1. Create an XML file named `elevate.xml` in the same directory as the `solrconfig.xml` file.

  2. Use the following as the contents of the `elevate.xml` file:

     ```xml theme={"dark"}
     <?xml version="1.0" encoding="UTF-8" ?>
     <elevate>
     </elevate>
     ```

  3. In the `solrconfig.xml` file, add the following in the elevator search Component (`searchComponent name="elevator"`). Before adding, check to see if the `searchComponent` already exists within the file.

     ```xml theme={"dark"}
       <searchComponent name="elevator" class="solr.QueryElevationComponent" >
         <str name="config-file">elevate.xml</str>
       </searchComponent>
     ```

  4. Add `elevator` as a 'last component' part of the select handler in the `solrconfig.xml` file. If a `last-components` array is not already defined, create it at the end of the select handler’s configuration. If one is already defined, add `<str>elevator</str>`.

     ```xml theme={"dark"}
       <requestHandler name="/elevate" class="solr.SearchHandler">
         <arr name="last-components">
           <str>elevator</str>
         </arr>
       </requestHandler>
     ```

  5. When you [create a new business rule](#create-a-rule), check the **USE QUERY ELEVATION COMPONENT** checkbox to use elevation.

       <img src="https://mintcdn.com/lucidworks/vupE2UCZdg04NdXx/assets/images/4.2/rules-qec.png?fit=max&auto=format&n=vupE2UCZdg04NdXx&q=85&s=212a50eb54e7de9fdb1374ef5764a7e7" alt="rules-qec" width="410" height="639" data-path="assets/images/4.2/rules-qec.png" />

  <Check>The Query Elevation Component only elevates documents within the [query rewriting rules engine](/docs/4/fusion-ai/concepts/query-rewriting/overview) by the document `id` field. Ensure `id` is entered in the "FIELD NAME" option.</Check>
</Accordion>

## Additional details

### Query pipeline stages for rules

These stages are part of the [default query pipeline](/docs/5/fusion/getting-data-out/query-basics/query-pipelines/overview):

<img src="https://mintcdn.com/lucidworks/1R8QVvJzt46cZDT6/assets/images/4.2/diagrams/rules-query-stages.png?fit=max&auto=format&n=1R8QVvJzt46cZDT6&q=85&s=27fbd1dfee4757a48e4add5e19bd1782" alt="Rules query stages in the query pipeline" width="500" height="324" data-path="assets/images/4.2/diagrams/rules-query-stages.png" />

* [Apply Rules](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/query-rules-query-stage)\
  This stage looks up rules that have been deployed to the [`COLLECTION_NAME_query_rewrite` collection](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) and matches them against the query. Matching rules that perform [query rewriting](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting) are applied at this stage, while matching rules that perform [response rewriting](/docs/5/fusion/getting-data-out/query-enhancement/response-rewriting) are applied by the [Modify Response with Rules](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/rules-augment-response-query-stage) stage later in the pipeline.

<Note>
  To trigger a rule that contains a tag, specify the tagname in the request URL of the user search app. See [Easily define triggers in tags](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/general-config) for more information.
</Note>

* [Modify Response with Rules](/docs/5/fusion/reference/config-ref/pipeline-stages/query-stages/rules-augment-response-query-stage)\
  Most rules operate on the request, but some [rule types](/docs/5/fusion/getting-data-out/query-enhancement/query-rewriting), such as banner rules or redirect rules, do their work when the response comes back. The Modify Response with Rules stage applies those rules to the response. For example, a banner rule can add a banner URL to the response before returning it to the client.

Generally, if you are using rules, you need both of these stages enabled in your query pipeline. The Apply Rules stage must come *before* the Solr Query stage, while the Modify Response with Rules stage must come *after* the Solr Query stage. Disabling or removing the Apply Rules stage will disable rules entirely. Disabling or removing the Modify Response with Rules stage will disable only the rules that perform [response rewriting](/docs/5/fusion/getting-data-out/query-enhancement/response-rewriting), if any.

### Rules on response signals

Response signals capture a list of rule IDs that match the query in a multi-valued field named `rule_ss`.

### Rules and experiments

The easiest way to integrate rules and experiments is to create one query pipeline with rules enabled and one without. Keep all other settings constant between the two pipelines. The pipeline without rules enabled must be configured manually.

To create an experimental rule, use tags on the rule and set the tag in one of the variant pipelines.

## FAQ

What are arbitrary values?

Arbitrary values are values that are not actively used by Fusion. Instead, they are used by the user or the search application. For example, the **Description** is considered an arbitrary value, as it serves only to inform the user what the business rule is used for.

## Learn more

<Card title="Query Rewriting with Business Rules and Search Rewrites" class="note-image" href="https://academy.lucidworks.com/query-rewriting-with-business-rules-and-search-rewrites" cta="Take this course on the LucidAcademy." icon="graduation-cap" iconType="duotone">
  The course for **Query Rewriting with Business Rules and Search Rewrites** focuses on how using business rules and search rewrites gives you the opportunity to boost conversions and create better customer experiences by improving your relevancy.
</Card>
