About this parameter
Defines how you want to render results in the search interface.
facetOrdering. Controls the order of facets in your UI.
values. Controls the order of specific facet values.
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 order
countsorts by facet value count, numerically in descending order
hiddenhides facet values that aren’t included in the
InstantSearch uses this property to define the UI through configuration—for example, with the
If you’re not using InstantSearch for your frontend, you can build a UI with
The following example snippet uses
renderingContent to define how results are displayed:
brandordering starts with “uniqlo” and all other facet values, such as “timberland”, are sorted by facet value count.
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 $index->setSettings([ 'renderingContent' => [ 'facetOrdering' => [ 'facets' => [ 'order' => ['size', 'brand'] ], 'values' => [ 'brand'=> [ 'order' => ['uniqlo'], 'sortRemainingBy' => 'count' ], 'size'=> [ 'order' => ['S', 'M', 'L'], 'sortRemainingBy' => 'hidden' ], ] ] ] ]);