renderingContent
'renderingContent' => array
Can be used in these methods:
setSettings
set_settings
setSettings
set_settings
setSettings
setSettings
SetSettings
setSettings
SetSettings
setSettings
About this parameter
Defines how you want to render results in the search interface.
You can set a default with setSettings and override it with Rules.
facetOrdering. Controls the order of facets in your UI.values. Controls the order and visibility of specific facet values withorderandhideproperties.sortRemainingBy. Determines how to sort remaining values if a facet value isn’t specified. It can be one of:alphasorts by facet value, alphabetically in ascending ordercountsorts by facet value count, numerically in descending orderhiddenhides facet values that aren’t included in thevalueslist.
widgets. Controls the configuration of specific InstantSearch widgets in your UI. You can’t set this property with thesetSettingsmethod. Use Rules instead.banners. Determines how InstantSearch may display any banner configured by Rules. If this property is populated, theHitswidget orInfiniteHitswidget displays a banner by default.
This property has a 2 MB size limit. Exceeding this limit will result in an error message. This is true when setting the property with setSettings or when using Rules to override it.
Usage notes
InstantSearch uses this property to define the UI through configuration—for example, with the dynamicWidgets widget.
If you’re not using InstantSearch for your frontend, you can build a UI with renderingContent
Examples
Set renderingContent
The following example snippet uses renderingContent to define how results are displayed:
brandordering starts with “uniqlo”, never shows the value “muji”, and all other facet values, such as “timberland”, are sorted by facet value count.- The
sizeordering sequence is “S”, “M”, and “L” and other facet values, such as “XS”, are hidden.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$index->setSettings([
'renderingContent' => [
'facetOrdering' => [
'facets' => [
'order' => ['size', 'brand']
],
'values' => [
'brand'=> [
'order' => ['uniqlo'],
'hide' => ['muji'],
'sortRemainingBy' => 'count'
],
'size'=> [
'order' => ['S', 'M', 'L'],
'sortRemainingBy' => 'hidden'
],
]
]
]
]);