Alokai

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

NameRequiredTypeDescription
fieldRequiredstringField of the Product Search index, e.g. variants.attributes.search-color.key
fieldTypeOptionalstringType of the indexed field, required by Product Search for some fields, e.g. enum
filteringStrategyOptional"postFilter" | "query"Whether the selected values narrow the results before facets are computed (query) or only after (postFilter, the default).
languageOptionalstringLanguage of a localized field, e.g. en
limitOptionalnumberMaximum number of buckets returned for a terms facet
nameRequiredstringName of the facet, used as the filter key and in the response. Use category for the category facet.
rangesOptional{ from?: number; to?: number; }[]Buckets of a range facet, in the units of the indexed field. Omit to for an open-ended range.
typeRequired"range" | "terms"

On this page