faceting property lets you customize this behavior per dimension.
You can configure dimensions to have suggestions that are:
- Independent of all other filters
- Dependent only on specific fields
- Filtered by all fields except specific ones
Syntax
Properties
The name of the dimension. Dimension names must:
- Be unique within the view
- Start with a letter
- Contain only alphanumeric characters and underscores
Faceting modes
| Configuration | Behavior |
|---|---|
No faceting property | Default: all active filters affect suggestions |
faceting: { depends_on: [] } | Independent: no filters applied to suggestions |
faceting: { depends_on: [fields] } | Include-list: only specified fields affect suggestions |
faceting: { exclude: [fields] } | Exclude-list: all fields affect suggestions except specified ones |
Examples
Independent suggestions
Make gender suggestions available regardless of other filter selections:Include-list faceting
City suggestions should only be filtered by country and state selections, ignoring all other active filters:Exclude-list faceting
First name suggestions should be filtered by all fields except state:Cross-view faceting in topics
In a topic-scoped view, reference fields from other views in the topic. This example makes city suggestions depend on the region from the orders view:Per-topic customization
Different topics can configure different faceting behavior for the same base view:Validation rules
Thefaceting property has several validation rules:
depends_onandexcludeare mutually exclusive - you cannot use both on the same dimensionfacetingcannot be used withsuggest_from_fieldorsuggest_from_topicon the same dimension- An empty
exclude: []array is invalid (has no effect) - Field references in
depends_onorexcludemust resolve to existing dimensions or filter-only fields (not measures) - Cross-view references are only allowed in topic-scoped views
- Self-references (a dimension depending on or excluding itself) will generate a warning
- Duplicate entries in
depends_onorexcludewill generate a warning
Related parameters
- suggest_from_field: Alternative way to control suggestion behavior by pulling from a different field
- suggest_from_topic: Pull suggestions from a field in a different topic
- suggestion_list: Provide a static list of suggestions