The Facets Object
The facets object (facets
) is included in every response when facets are configured in Experience OS. It provides the available filters, their corresponding values, and their aggregations, which can be displayed to the user on the search listing page.
The facet
object includes:
- column: The name of the facet column.
- valuesType: Data type (string, number, date).
- displayName: A human-readable facet name.
- values (for Number fields):
- name: Facet value.
- min: The minimum value returned by any of the results (the lowest value in ‘column’ found in the results).
- max: The maximum value returned by any of the results (the highest value in ‘column’ found in the results).
- values (for String fields):
- name: Facet value.
- count: The number of results matching this value.
Example: Present search filtering options
This example shows how you can enable users to filter search results by selecting product characteristics, including color and price range, and see how many products there are that match each filtering criterion.
"facets": [
{
"column": "color",
"valuesType": "string",
"displayName": "Color",
"values": [
{ "name": "black", "count": 560 },
{ "name": "white", "count": 191 }
]
},
{
"column": "price",
"valuesType": "number",
"displayName": "Price",
"min": 2,
"max": 100
}
]
Notes:
- Available for Visual Search and Semantic Search only.
- Up to 50 facets per query, each with up to 50 values.
- Facets values are automatically localized based on the context
lng
parameter and the associated product feed ‘lng’ column.
Updated 9 days ago