public function aroundGetResultCount(Result $resultBlock, \Closure $proceed)
    {
        if ($this->resultCount === null) {
            $size = $resultBlock->getListBlock()->getLoadedProductCollection()->getSize();
            $this->resultCount = $size;
        }

        return $this->resultCount;
    }
public function aroundGetResultCount(Result $resultBlock, \Closure $proceed)
    {
        if ($this->resultCount === null) {
            $size = $resultBlock->getListBlock()->getLoadedProductCollection()->getSize();
            $this->resultCount = $size;
        }

        return $this->resultCount;
    }
public function aroundGetResultCount ( Result $ resultBlock , \ Closure $ proceed ) { if ( $ this -> resultCount === null ) { $ size = $ resultBlock -> getListBlock ( ) -> getLoadedProductCollection ( ) -> getSize ( ) ; $ this -> resultCount = $ size ; } return $ this -> resultCount ; }
Avoid the search result count to be saved by the original method.

@SuppressWarnings(PHPMD.UnusedFormalParameter)

@param \Magento\CatalogSearch\Block\Result $resultBlock Result block.
@param \Closure                            $proceed     Original method.

@return integer
Avoid the search result count to be saved by the original method .