0

I have change the Batch size for Magento 2.4

var/www/html/Mag/app/code/Reg/Indexer/etc/adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
    <arguments>
        <argument name="batchRowsCount" xsi:type="array">
            <item name="configurable" xsi:type="number">500</item>
            <item name="default" xsi:type="number">500</item>
        </argument>
    </arguments>
</type>
</config>

On running the indexer process it gives an error

Category Products index PHP Fatal error: Uncaught Error: Unsupported operand types in /var/www/html/Mag/vendor/magento/framework/Indexer/BatchSizeManagement.php:49 Stack trace: #0 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(269): Magento\Framework\Indexer\BatchSizeManagement->ensureBatchSize(Object(Magento\Framework\DB\Adapter\Pdo\Mysql\Interceptor), Array) #1 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(227): Magento\Catalog\Model\Indexer\Category\Product\Action\Full->reindexCategoriesBySelect(Object(Magento\Framework\DB\Select), 'cp.entity_id IN...', Object(Magento\Store\Model\Store\Interceptor)) #2 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Action/Full.php(192): Magento\Catalog\Model\Indexer\Category\Product\Action\Full->reindexRootCategory(Object(Magento\Store\Model\Store\Interceptor)) #3 /var/www/html/Mag/vendor/magento/module-catalog/Model/Indexer/Category/Product/Actio in /var/www/html/Mag/vendor/magento/framework/Indexer/BatchSizeManagement.php on line 49

Any help is appreciated.

1 Answer 1

1

Update

Try this

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
        <arguments>
            <argument name="batchRowsCount" xsi:type="number">500</argument>
        </arguments>
    </type>
    <type name="Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\BatchSizeCalculator">
        <arguments>
            <argument name="batchRowsCount" xsi:type="array">
                <item name="configurable" xsi:type="number">500</item>
            </argument>
        </arguments>
    </type> 
</config>

Also check this

1
  • Thanks it worked for me.
    – Prits
    Feb 8, 2021 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.