The filter response object
You get a response filter object in the Sitecore Discover Search and Recommendation response if you send a request The filter request object. The response returns content and facets according to the filters added to your request.
The Using search filters example has more information on how to use this object,
The following code shows the basic structure of the response filter object with a range filter applied:
{
"filter": {
"<filter_type>": {
"display_name": "<display_name>",
"value": [{
"filter_id": "<filter_value_id>"
"text": "<display_text>",
"min": 1,
"max": 10
}]
}
}
}Keys
Depending on your request you may see some or all response keys.
The following table describes the keys in the filter request object:
|
Key |
Type |
Description |
|---|---|---|
|
|
Returns the |
Filter type object
The following table describes the keys in the filter_type object:
|
Key |
Type |
Description |
|---|---|---|
|
|
string |
Alternate name to display the You can contact your support representative if you want the response to display a different name for the returned |
|
|
Contains the values of the filtered item. If you requested a range filter, this object returns the minimum and maximum values. |
Value object
The following table describes the keys in the value object:
|
Key |
Type |
Description |
|---|---|---|
|
|
string |
A unique ID that corresponds to the filter value. Use the Note If a |
|
|
string |
Alternate name to display the |
|
|
number |
The minimum value in a range. The response returns this only when the |
|
|
number |
The maximumvalue in a range. The response returns this only when the |
Filter types
The following are default filters that come with all implementations. You can define additional facet types that are specific to your business when you do the initial data feed
|
Filter type |
Description |
|---|---|
|
|
Filter by product brands. |
|
|
Filter by product category names. |
|
|
Filter by price or price range. |
|
|
Filter by product review rating. You must specify a |