Faceting
Faceting is a powerful tool for E-commerce website, find below how you can configure it with XO Search
This feature is only available for the Search API
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 |
|
| ✖ | 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:
Property | Type | Description |
---|---|---|
|
| ID of the facet to select |
| array of | 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
All responses from XO Search uses the same format. Check API Reference page for a more detailed description of this format.
pageAPI ReferenceUsage 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