From 29780ee72563fb9f77785a0adf29e65d3acbbda7 Mon Sep 17 00:00:00 2001 From: Romain Ruaud Date: Tue, 5 Mar 2019 15:41:53 +0100 Subject: [PATCH] Rework attribute filter model to be compatible with latest Elasticsuite. --- Model/Layer/Filter/Rating.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Model/Layer/Filter/Rating.php b/Model/Layer/Filter/Rating.php index 40a5385..c3f72c2 100644 --- a/Model/Layer/Filter/Rating.php +++ b/Model/Layer/Filter/Rating.php @@ -31,13 +31,16 @@ class Rating extends \Smile\ElasticsuiteCatalog\Model\Layer\Filter\Attribute */ public function addFacetToCollection($config = []) { - $facetField = $this->getFilterField(); - $facetType = \Smile\ElasticsuiteCore\Search\Request\BucketInterface::TYPE_HISTOGRAM; - $facetConfig = ['minDocCount' => 1, 'interval' => (int) self::RATING_AGG_INTERVAL]; + $facetConfig = [ + 'name' => $this->getFilterField(), + 'type' => \Smile\ElasticsuiteCore\Search\Request\BucketInterface::TYPE_HISTOGRAM, + 'minDocCount' => 1, + 'interval' => (int) self::RATING_AGG_INTERVAL + ]; /** @var \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $productCollection */ $productCollection = $this->getLayer()->getProductCollection(); - $productCollection->addFacet($facetField, $facetType, $facetConfig); + $productCollection->addFacet($facetConfig); return $this; }