---
title: "Query builder"
slug: "query-builder"
abstract: "How to configure advanced search filters based on specific fields."
---
# Query builder

The **Query builder** lets you display an advanced search section on the page, providing additional filter settings based on specific fields.

<details>
<summary>Example</summary>

In the following example, the **Assets** page includes a query builder filter that lets users create dynamic filters.

Here, the fields are:

- *Asset - Title (Title)*
- *Asset - Filename (FileName)*
- *System - Created by*
- *System - Created on*

The following dynamic values create an offset that only includes results from the past two days.

- Operator - minus
- Offset - *2*
- Unit of measurement - *Days*

![Query builder example](https://doc.sitecore.com/api/markdown-image/ch/en/users/content-hub/images/query_builder_example.png)

</details>

> [!note]
> You cannot use the properties of related items as facet or query builder options.

> [!note]
> **Before you begin**
> -   [Add a **Search** component](https://doc.sitecore.com/ch/en/users/content-hub/add,-modify,-or-delete-page-components.html "Add, modify, or delete page components") to the page.

## Configure the query builder

You can add queries and dynamic value filters to the advanced search section.

To add a query:

1. On the **Layout** tab, click the page component to open its details page.
2. In the **Tools** section, turn on the **Query builder** switch.
3. On the **Fields** tab, click :mdiPlus: **Add query**.
4. Select one of the following field types and configure its available settings:
    - **Definition** - the entity definition and label type.
    - **Field** - the entity definition, field in the selected definition, and label type. The possible values vary with the selected definition.
    - **System** - a system property.
5. Click **Save**.

To add a dynamic value:

1. On the **Dynamic values** tab, click :mdiPlus: **Add dynamic value**.
2. Set the following parameters:

    | Field | Description |
    | --- | --- |
    | **Operator** | Use a minus if the offset is before the current date, or a plus if it is after the current date. |
    | **Offset** | The offset value. |
    | **Unit of measurement** | The offset unit. |

3. Click **Save**.