# Filters

#### Filter

The **Filter** rule allows you to restrict the list of products returned by your strategy based on one or several conditions.\
Once the base set is defined, filters are applied in sequence before sorting or limiting the results.

#### How it works

Each filter is composed of three parts:

| Element      | Description                                                                                              |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| **Property** | The product attribute used for filtering (e.g., `id`, `price`, `active`, `brand`, `availability`, etc.). |
| **Operator** | The comparison type, which depends on the property type (see table below).                               |
| **Value**    | The value or list of values used for filtering.                                                          |

#### Filtering by lists (IDs, SKUs, etc.)

When the selected property is an identifier (e.g., `id`), you can filter multiple values at once using the operator <kbd>**is included in**</kbd>**.**\
You can either paste or select multiple values directly from the dropdown.

Example:\
`Property: id` → `Operator: is included in` → `Values: 50365009101109, 46857535914293, 46856949662005`

{% hint style="info" %}
Values can be pasted in bulk, separated by commas or semicolons, with or without spaces. This enables quick filtering of 10–20 or more values without requiring a CSV upload or regex.
{% endhint %}

#### Combining multiple filters

You can add conditions using <kbd>**AND**</kbd> or <kbd>**OR**</kbd> operators:

* <kbd>**AND**</kbd> means all conditions must be met.
* <kbd>**OR**</kbd> means at least one condition must be met.

The <kbd>**Add condition**</kbd> button allows you to combine several filters.\
Example:\
`brand = Nike AND price < 100`\
`category = Shoes OR category = Sneakers`

#### Operators by property type

| Property Type        | Example Properties              | Available Operators                                                                   | Notes                                      |
| -------------------- | ------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------ |
| **Numeric**          | `price`, `stock`, `rating`      | is equal to, is different from, is greater than, is less than, is empty, is not empty | Standard numerical comparison              |
| **String / Text**    | `brand`, `category`, `img_link` | is equal to, is different from, contains, does not contain, is empty, is not empty    | Case-insensitive                           |
| **Boolean**          | `active`, `is_best_seller`      | is equal to, is different from, is empty, is not empty                                | True/false logic                           |
| **List / ID**        | `id`, `sku`, `collection_id`    | is included in, is not included in, is equal to, is different from                    | Allows multi-value copy-paste or selection |
| **Date / Timestamp** | `created_at`, `updated_at`      | is before, is after, is equal to, is empty, is not empty                              | Depends on dataset format                  |

#### Example use cases

* Include a specific list of SKUs: `id is included in [50365009101109, 46857535914293]`
* Show only active products: `active = true`
* Exclude out-of-stock products: `stock > 0`
* Combine brand and price: `brand = Nike AND price < 100`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/recommendations-and-merchandising/concepts/strategies/rules/custom-rules/filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
