---
title: Filters and facets
description: Filtering capabilities of Luigi's Box Search, from simple key-value pairs to complex boolean logic.
slug: search/guides/filters-and-facets
docKind: guide
hub: search
---

Learn about the filtering capabilities of Luigi's Box Search, from simple key-value pairs to complex boolean logic.

## Basic filtering

To filter search results, use the `f[]` parameter. This parameter accepts key-value pairs (`field:value`).

**Example:**
`f[]=category:jackets`

**Logic:**

- Filters of the **same type** (same field) are combined with **OR**.
- Filters of **different types** (different fields) are combined with **AND**.

**Example request:**
`f[]=category:jackets&f[]=category:windproof&f[]=brand:Adidas`

**Interpretation:**
(Category is `jackets` **OR** `windproof`) **AND** (Brand is `Adidas`)

## Boolean logic

### OR logic (default)

As shown above, simply repeating the `f[]` parameter for the same field creates an OR condition.

### AND logic (`f_must[]`)

To force an **AND** condition between filters of the same type, use the `f_must[]` parameter.

**Example:**
Find products that are in *both* `jackets` AND `windproof` categories.

`f_must[]=category:jackets&f_must[]=category:windproof`

See the [f_must[] parameter reference](/search/api/v2/search/) for more details.

### Complex logic (nested AND/OR/NOT)

For advanced scenarios requiring nested logic (e.g., "(A OR B) AND (C OR D) AND NOT E"), use the **POST** method instead of GET. You define the logic in a JSON payload.

**Method:** `POST`

**URL:** `https://live.luigisbox.com/search`

See the [Search API reference](/search/api/v2/search/) for the complete payload structure and examples.

:::note
Complex filters are strict: they limit the scope of *all* facets, unlike standard filters which often allow "multi-select" behavior in facets.
:::

## Handle missing values

By default, filtering by a field excludes items where that field is missing. To include them, use the special value `value_missing`.

**Example:**
Get items where `color` is `red` **OR** `color` is missing (undefined).

`f[]=color:red&f[]=color:value_missing`

This works for `numeric`, `date`, `boolean`, and `text` filters.

## Facets

Facets provide the "filters" typically seen in the sidebar of a search result page. The API returns the available counts for each facet value based on the current query.

**Example flow:**

1. **Initial query:** `yamaha`
   - **Facets returned:**
     - `Condition`: `new (822)`, `used (1)`
     - `Category`: `guitars (423)`, `pianos (400)`

2. **User filters:** `Condition: used`
   - **Result:**
     - **Condition facet:** Still shows `new (822)`, `used (1)` (so the user can uncheck or switch).
     - **Category facet:** Updates to `guitars (1)`. Pianos are removed because no used pianos match the query.

### Dynamic facets

For catalogs with many attributes, manually selecting which facets to display is inefficient. Use the `dynamic_facets_size` parameter to let the AI model automatically select the most relevant facets for the specific query (e.g., showing "Bridge Type" for guitars but "Number of Keys" for pianos).

See [dynamic_facets_size](/search/api/v2/search/) in the reference.
