While re indexing got an error:
PHP Fatal error: Uncaught Error: Call to undefined method Magento\Customer\Model\Indexer\Source::addAttributeToSelect() in /var/www/html/ncsmokehouse/vendor/magento/framework/Indexer/Handler/AttributeHandler.php:38
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityWhile re indexing got an error:
PHP Fatal error: Uncaught Error: Call to undefined method Magento\Customer\Model\Indexer\Source::addAttributeToSelect() in /var/www/html/ncsmokehouse/vendor/magento/framework/Indexer/Handler/AttributeHandler.php:38
Add a function :
public function addAttributeToSelect($fieldName, $alias = null)
{
$this->customerCollection->addAttributeToSelect($fieldName, $alias);
return $this;
}
in this file /www/vendor/magento/module-customer/Model/Indexer/Source.php
you can override this file because we can't change in core module. it's working
In my case, it works. However, after that, I've found another reindex issue, which I've solved by following this Magento 2 How to Unlock Reindex Process: Index is locked by another reindex process Skipping