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

# Conditions

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

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

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

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

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.

Query profile triggers can be tested in the [Query Workbench](/docs/5/fusion/intro/ui-tour/query-workbench) or with the [Query Pipelines API](/api-reference/query-pipelines-api/get-all-query-pipelines) by setting `queryProfileID` parameter on the request.

For more information, see [Business Rules Conditions Concepts](/docs/5/fusion/getting-data-out/query-enhancement/business-rules/conditions).

<LwTemplate />

## Configuration options

### Condition types

#### Dates

| Required | Parameter | Description                           | Example                                |
| -------- | --------- | ------------------------------------- | -------------------------------------- |
| ✅        | **Dates** | The date and time range for the rule. | `01/01/2021 12:00 to 01/31/2021 12:00` |

#### Field value

| Required | Parameter   | Description                                                                                                                                                                                                                                                                                                                           | Example                                            |
| -------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| ✅        | **Filters** | The filters that determine whether the rule fires: <br />● Field name. The name of the field that the rule action applies to. The documents in the datasource determine what fields are available.<br />● Field value. The values of the field that the rule action applies to. The field determines what field values are available. | Field name: `color_group_name`  Field value: `red` |

#### Query

| Required | **Parameter**         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Example                |
| -------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| ✅        | **Match query using** | Method used for query matching. Choose from the following: <br />● `keywords`. The query must match the keywords of the **Search terms** value exactly. For example, if the **Search terms** value is `red pants`, only that value triggers the rule. The rule is not triggered if the value is `red`, `pants`, or `small red pants`.<br />● `phrase`. The search query must contain one of the **Search terms** values as a subphrase, and in the same order. For example, if the **Search terms** value is `yellow shirt`, the rule is triggered by `yellow shirt` and `small yellow shirt`. The rule is not triggered if the value is `yellow small shirt`.<br />● `text`. At least one of the **Search terms** values must match the query, but unlike `phrase`, the query only needs to match part of the value. For example, if the **Search terms** value is `green hat`, the rule is triggered by `green hat`, `green`, `hat`, and `large green hat`. | `keywords`             |
| ✅        | **Search terms**      | Search terms that will trigger the rule. Terms can be words or phrases.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | `sale`, `shoes`, `red` |

#### Query profile

| Required | Parameter            | Description                                                                        | Example       |
| -------- | -------------------- | ---------------------------------------------------------------------------------- | ------------- |
| ✅        | **Query profile ID** | The ID of the query profile that allows the rule to fire. Accepts multiple values. | `myFusionApp` |
