Faceting
Faceting is a powerful tool for E-commerce website, find below how you can configure it with XO Search
Parameters
The faceting parameters allows the developer to enable/disable faceting results, and to filter search results using specific facets values.
Name
Type
Is Required ?
Default value
facets
array
✖
empty array
facets
facets
If specified, perform a search using the selected facets and values. This parameter must be an array of JSON objects. Each object should have the following properties:
id
string
ID of the facet to select
values
array of string
Items should have at least one
of these values for the selected facet
Notes
Unknown facets values will lead to empty responses.
Calling facets by attribute
has been deprecated and will soon be no longer supported. Please use the id
field in the API request.
Response
Usage examples
Filter results based on facets values
Retrieve only items with the facet
size
set to one of the[46, 48, 50]
values
NodeJS / NPM example
HTML example
Retrieve only items with the facet
size
set to46
and the facetcolor
set to one of[23, 26]
values
NodeJS / NPM example
HTML example
Last updated