From 0732e433ebbfdef8efdf7cd40f70bd00145549b8 Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Tue, 29 Oct 2019 17:49:11 +0100 Subject: [PATCH] Fixes #1581 Explicit fulltext collection page size to avoid a pageSize of getSize() set in the collection ie all matching products. Problematic on a virtual category without any rule set yet: the whole catalog matches. Quite costly if the catalog is even of a medium size (~ 50K products). --- .../Plugin/Ui/Category/Form/DataProviderPlugin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php b/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php index fd5f9dcff..04ce00262 100644 --- a/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php +++ b/src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php @@ -237,6 +237,7 @@ private function getAttributes($category) /** @var \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Fulltext\Collection $fulltextCollection */ $fulltextCollection = $this->fulltextCollectionFactory->create(); $fulltextCollection->setStoreId($storeId) + ->setPageSize(1) ->addFieldToFilter('category_ids', $this->getCategoryFilterParam($category)); $attributeSetIds = array_keys($fulltextCollection->getFacetedData('attribute_set_id'));