- Type:
list<string>
- Default:
[]
(no facets) - Scope:
settings
attributesForFaceting
.
To learn more, see Declare attributes for faceting.
There’s no hard limit on the number of attributes you can include,
but adding too many can slow down
getSettings
operations
and degrade performance in the Algolia dashboard.Usage
- Attribute names are case-sensitive
-
Declaring an attribute here enables:
- Faceting—use attributes inside facets
- Filtering—use attributes inside
filters
,facetFilters
, andoptionalFilters
-
You can use nested attributes for faceting,
such as
authors.mainAuthor
. In this case, onlymainAuthor
is used for faceting. -
Avoid colons (
:
) in facet attribute names faceting as thefilters
syntax uses colons as delimiters.
Modifiers
Use modifiers to change the behavior of faceted attributes.filterOnly
Marks an attribute as available only for filtering—not faceting.
This is useful when you want to filter by an attribute but don’t need to display its facet values.
It also reduces index size and improves performance.
You can’t use
filterOnly
and searchable
together.searchable
Makes a facet searchable—users can type to find facet values.You can combine this modifier with
afterDistinct
: afterDistinct(searchable(attribute))
.You can’t use
filterOnly
and searchable
together.afterDistinct
Ensures facet counts reflect only unique records when using the
distinct
setting.
Use this when deduplicating records and you want accurate facet counts.- Only use
afterDistinct
on attributes shared by all records with the same distinct key. - If
facetingAfterDistinct
is also set totrue
, it takes precendence and applies to all the query’s facets.
searchable
: afterDistinct(searchable(attribute))
.Example
The following example:- Defines some attributes as facets:
author
,edition
,category
, andpublisher
- Sets the
isbn
attribute as only usable for filtering - Allows the
edition
andpublisher
facet values to be searchable
Current API clients
Current API clients
Legacy API clients
Legacy API clients