$facets public property
Facet search specifications. For example:
[
'group_id',
'brand_id' => [
'order' => ['COUNT(*)' => SORT_ASC],
],
'price' => [
'select' => 'INTERVAL(price,200,400,600,800) AS price',
'order' => ['FACET()' => SORT_ASC],
],
'name_in_json' => [
'select' => [new Expression('json_attr.name AS name_in_json')],
],
]
You need to use search() method in order to fetch facet results.
Note: if you specify custom select for the facet, ensure facet name has corresponding column inside it.
Please login to continue.