ProductSearchFacetConfig
Facet available in the getFacet endpoint when the productSearch search API is used.
interface ProductSearchFacetConfig {
field: string;
fieldType?: string;
filteringStrategy?: "postFilter" | "query";
language?: string;
limit?: number;
name: string;
ranges?: {
from?: number;
to?: number;
}[];
type: "range" | "terms";
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
field | Required | string | Field of the Product Search index, e.g. variants.attributes.search-color.key |
fieldType | Optional | string | Type of the indexed field, required by Product Search for some fields, e.g. enum |
filteringStrategy | Optional | "postFilter" | "query" | Whether the selected values narrow the results before facets are computed (query) or only after (postFilter, the default). |
language | Optional | string | Language of a localized field, e.g. en |
limit | Optional | number | Maximum number of buckets returned for a terms facet |
name | Required | string | Name of the facet, used as the filter key and in the response. Use category for the category facet. |
ranges | Optional | { from?: number; to?: number; }[] | Buckets of a range facet, in the units of the indexed field. Omit to for an open-ended range. |
type | Required | "range" | "terms" |