sphinx\Query $facets

$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.

public array $facets = []
doc_Yii
2016-10-30 17:12:12
Comments
Leave a Comment

Please login to continue.