Configuring a Custom Product Indexing Batch Size
5 min
configuring a custom product indexing batch size the product indexing module defines a batched entity provider using magento dependency injection in etc/di xml by default, the batch size is configured on the following virtual type klevu\indexingproducts\service\provider\productentityprovider\batched this virtual type sets the constructor argument batchsize and the module assigns it the default value klevu\indexing\constants default indexing batch size how to override the batch size to use a custom batch size, add a di override in your custom module’s etc/di xml and set a numeric value for the batchsize argument example \<?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="klevu\indexingproducts\service\provider\productentityprovider\batched"> \<arguments> \<argument name="batchsize" xsi\ type="number">500\</argument> \</arguments> \</type> \</config> why this works the module declares a shared batched provider klevu\indexingproducts\service\provider\productentityprovider\batched other batched product provider variants inherit from it, including klevu\indexingproducts\service\provider\productentityprovider\batched\simple klevu\indexingproducts\service\provider\productentityprovider\batched\virtual klevu\indexingproducts\service\provider\productentityprovider\batched\downloadable klevu\indexingproducts\service\provider\productentityprovider\batched\bundle klevu\indexingproducts\service\provider\productentityprovider\batched\grouped klevu\indexingproducts\service\provider\productentityprovider\batched\configurable klevu\indexingproducts\service\provider\productentityprovider\batched\configurablevariants overriding the shared batched type updates the batch size used by all of these, unless a more specific subtype override is also declared example use case if you want to increase the number of products processed in each batch during discovery, set a larger value such as \<argument name="batchsize" xsi\ type="number">500\</argument> if you want smaller, more conservative processing batches, use a lower value notes the value must be numeric this change should be added in a custom module, not by editing the vendor module directly after updating di configuration, run the appropriate magento cache/compiled dependency refresh steps for your environment summary to pass a custom batchsize , override this di argument in your custom module type klevu\indexingproducts\service\provider\productentityprovider\batched argument batchsize example \<type name="klevu\indexingproducts\service\provider\productentityprovider\batched"> \<arguments> \<argument name="batchsize" xsi\ type="number">500\</argument> \</arguments> \</type>
