> For the complete documentation index, see [llms.txt](https://docs.codegiganten.de/plugin-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/filters.md).

# Filters

Create and edit filters as a list or slider, with position, NLP keywords and all options.

With filters you decide which ways of narrowing down results your customers see in the search, for example by category, price, size, color or brand. Filters appear next to or above the search results and help to quickly reduce large result sets. You maintain them in the plugin dashboard under **Filters**.

<figure><img src="https://923488348-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FebcjSiStaIxyVJ83vjsL%2Fuploads%2Fgit-blob-b2ae11f8c21050ca6802e260bd3184129571db9d%2Fsuche-intelligent-und-ki-optimiert-filter.png?alt=media" alt="Filters area with five filters per data source: name, display, position, edit and delete"><figcaption></figcaption></figure>

At the top, choose the data source under "Select product feed". The overview "Configured filters per data source" shows how many filters each source has. The list shows each filter's name, type (list or slider) and position, plus the buttons "Edit" and "Delete". Filters that are only used by the shopping assistant carry the label "assistant only". The "Add" button appears as soon as a source is selected.

{% hint style="warning" %}
Whether your customers see filters in the search window at all is controlled by the switch for enabling filters in the search in the plugin configuration. It is off by default.
{% endhint %}

## Requirements

A filter is built on a data attribute. Only fields that meet both conditions are available as filters:

1. The field is enabled under **Edit data fields**.
2. The data attribute is activated in the **Data attributes** area (column "Active").

If an attribute is missing from the selection, enable it in these places and re-read the product data under **Sources** with "Re-read product data". Changing the type of a data attribute also takes effect only after the next import.

A slider is meant for number fields. If a range filter such as "from 20" does not work, check in the data attributes whether the field has the type "Number", and look out for the "Check type" marker there.

## Which numbers filters show

The counters next to filter options count variants, not products. If you combine variants into one hit in the search, the number next to an option can therefore be higher than the number of hits in the list.

## Create or edit a filter

1. Choose the data source under "Select product feed".
2. Click "Add", or "Edit" on an existing filter. The same dialog opens.
3. Fill in the fields (table below).
4. Click "Save". The button becomes active once source, attribute, name and type are filled in.

Before deleting, the browser asks for confirmation.

### Fields in the dialog

| Field                  | Effect                                                                                                                                                                                                             | Default                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
| "Attribute" (required) | The product field the filter is based on, i.e. the raw value from your product data. Example: `g:brand` stands for the manufacturer, `g:color` for the color. Only enabled and activated attributes can be chosen. | none                       |
| "Name" (required)      | The title your customers see in the shop, for example "Brand", "Color", "Size" or "Price".                                                                                                                         | empty                      |
| "Type" (required)      | "List" for several values such as brands or colors, "Slider" for ranges such as price or size.                                                                                                                     | "List"                     |
| "Position" (required)  | A number. Smaller values appear higher in the filter list.                                                                                                                                                         | 0                          |
| "Default state"        | "Default (global setting)", "Always open" or "Always closed". Determines whether the filter group is expanded when results load.                                                                                   | "Default (global setting)" |
| "NLP keywords"         | Terms customers use in natural language to ask for this filter (see below).                                                                                                                                        | empty                      |
| "Active"               | Turns the filter on or off.                                                                                                                                                                                        | on                         |
| "Show in search"       | Off: the filter is only used by the shopping assistant and does not appear in search and listings.                                                                                                                 | on                         |

Groups with selected values are always expanded in the shop, whatever the default state.

## Type "List"

The list shows selection buttons with a label and hit count. Customers can choose several values per group. Only options that exist for the current search appear. How many options are visible before "Show more" appears is set in the plugin configuration under "Visible options per filter" (1 to 50, default 5).

## Type "Slider"

For numeric values such as price or weight, you display a filter as a slider. As soon as you choose the type "Slider", the section "Advanced display (slider)" appears in the dialog.

| Field                 | Effect                                                                                                                                                        | Default            |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| "Step size"           | Distance between two slider positions. Leave empty: the step size is calculated from the value range.                                                         | "auto"             |
| "Decimal places"      | Number of decimal places shown, 0 to 4.                                                                                                                       | 0                  |
| "Bound rounding"      | "Default", "Round numbers", "To the step size" or "None". Defines how the ends of the slider are rounded.                                                     | "Default"          |
| "Input mode"          | "Default (slider)", "Slider only", "Number fields only", "Slider and number fields" or "Price steps" (selection buttons such as "up to 20 €" with hit count). | "Default (slider)" |
| "Prefix"              | Text before the value.                                                                                                                                        | empty              |
| "Suffix"              | Text after the value, for example `€` with a leading space.                                                                                                   | empty              |
| "Unit"                | Always appended, independent of prefix and suffix, for example "kg".                                                                                          | empty              |
| "Currency"            | If set, it overrides prefix and suffix, for example "EUR".                                                                                                    | empty              |
| "Lower bound"         | Smallest value of the slider.                                                                                                                                 | empty              |
| "Upper bound"         | Largest value of the slider, regardless of the actual values. Also applies to the search itself, not just the display.                                        | empty              |
| "When only one value" | "Hide (default)" or "Show anyway".                                                                                                                            | Hide               |
| "Histogram"           | Shows the distribution of hits as bars above the slider. Needs a lower and upper bound, otherwise it stays off.                                               | off                |
| "Bars"                | Number of bars, 4 to 100. Only editable when the histogram is on.                                                                                             | 20                 |
| "Bar width"           | Width of one bar. Leave empty: the width is calculated from the lower and upper bound.                                                                        | "auto"             |

Only the values you set are saved. In the shop, a new search runs only after the slider is released, not at every intermediate step.

{% hint style="info" %}
With automatic step size, the distance depends on the range of values: up to 5 it is 0.1, up to 100 it is 0.5, above that 1.
{% endhint %}

For values that are not numbers (for example sizes such as S, M, L), the shop shows a step slider over the ordered values.

## NLP keywords

NLP ("Natural Language Processing") means that the search understands whole sentences, for example "only red shoes" or "show me brand products". With NLP keywords you store the words customers use to aim at a filter.

Examples:

* **Brand filter:** You enter "brand", "manufacturer", "label". The search then recognizes phrases with these words and applies the filter.
* **Filter with unit:** If you stored the keyword "kg" on a range filter, the search understands "under 5 kg", "from 2 kg", "between 2 and 5 kg" and "5 kg" as ranges.
* **Prices in the text:** Phrases such as "under 50 €", "up to 100 euro", "from 20 €" or "between 20 and 40 euro" set a price filter and are removed from the search text. This only works if a slider is set up for the price. Otherwise the text stays in the search and nothing is filtered.

If a word in the input matches a filter value, the search can set it as a filter itself, for example for “only red shoes”. The NLP keywords of the filter help with this. There is no separate switch for it.

## Filters only for the shopping assistant

If you turn off "Show in search", the filter no longer appears in search and listings. The shopping assistant (beta) keeps using it, and in the list it carries the label "assistant only". This way you keep filters ready that make sense for a consultation but would clutter your filter bar.

## When changes are visible in the shop

Filter settings are cached. Changes are therefore visible in the shop after up to 5 minutes. New data attributes as a basis additionally need the product data to be read in again.

## Tips

* Create only filters your customers really use. A short filter bar is easier to read.
* Assign positions in steps of ten (10, 20, 30). That way you can insert a filter in between later without renumbering everything.
* For price, a slider with currency, lower and upper bound and histogram works well.
* After saving, check how the filter looks in the shop. For mobile devices, you set in the plugin configuration whether filters are visible right away or collapsed behind a button.

## Read more

{% content-ref url="/pages/0hGQB6UOZSi6fc9UUDYL" %}
[Data attributes](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/data-attributes.md)
{% endcontent-ref %}

{% content-ref url="/pages/jaQ6nXm2Ug0rov8AO38O" %}
[Synonyms](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/synonyms.md)
{% endcontent-ref %}

{% content-ref url="/pages/6kroCulv1yWVL5LqIxhm" %}
[Search results page](https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/search-results-page.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.codegiganten.de/plugin-documentation/en/apps/search-intelligent-and-ai-optimized/filters.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
