Skip to content

Commit

Permalink
MC-16239: Search result page contain 24k results
Browse files Browse the repository at this point in the history
  • Loading branch information
vgoncharenko committed May 21, 2019
1 parent b651a26 commit 9ab466d
Show file tree
Hide file tree
Showing 35 changed files with 357 additions and 518 deletions.
9 changes: 7 additions & 2 deletions app/code/Magento/Backend/Block/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Backend\Block;

use Magento\Framework\Cache\LockGuardedCacheLoader;

/**
* Constructor modification point for Magento\Backend\Block\AbstractBlock.
*
Expand Down Expand Up @@ -44,8 +46,9 @@ class Context extends \Magento\Framework\View\Element\Context
* @param \Magento\Framework\Escaper $escaper
* @param \Magento\Framework\Filter\FilterManager $filterManager
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Framework\AuthorizationInterface $authorization
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
* @param LockGuardedCacheLoader $lockQuery
* @param \Magento\Framework\AuthorizationInterface $authorization
*
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
Expand All @@ -67,6 +70,7 @@ public function __construct(
\Magento\Framework\Filter\FilterManager $filterManager,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
LockGuardedCacheLoader $lockQuery,
\Magento\Framework\AuthorizationInterface $authorization
) {
$this->_authorization = $authorization;
Expand All @@ -87,7 +91,8 @@ public function __construct(
$escaper,
$filterManager,
$localeDate,
$inlineTranslation
$inlineTranslation,
$lockQuery
);
}

Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Backend/Block/Template/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Backend\Block\Template;

use Magento\Framework\Cache\LockGuardedCacheLoader;

/**
* Constructor modification point for Magento\Backend\Block\Template.
*
Expand Down Expand Up @@ -72,6 +74,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context
* @param \Magento\Framework\Filter\FilterManager $filterManager
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
* @param LockGuardedCacheLoader $lockQuery
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\View\FileSystem $viewFileSystem
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
Expand Down Expand Up @@ -106,6 +109,7 @@ public function __construct(
\Magento\Framework\Filter\FilterManager $filterManager,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
LockGuardedCacheLoader $lockQuery,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\View\FileSystem $viewFileSystem,
\Magento\Framework\View\TemplateEnginePool $enginePool,
Expand Down Expand Up @@ -143,6 +147,7 @@ public function __construct(
$filterManager,
$localeDate,
$inlineTranslation,
$lockQuery,
$filesystem,
$viewFileSystem,
$enginePool,
Expand Down
5 changes: 5 additions & 0 deletions app/code/Magento/Backend/Block/Widget/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Backend\Block\Widget;

use Magento\Framework\Cache\LockGuardedCacheLoader;

/**
* Constructor modification point for Magento\Backend\Block\Widget.
*
Expand Down Expand Up @@ -55,6 +57,7 @@ class Context extends \Magento\Backend\Block\Template\Context
* @param \Magento\Framework\Filter\FilterManager $filterManager
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
* @param LockGuardedCacheLoader $lockQuery
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\View\FileSystem $viewFileSystem
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
Expand Down Expand Up @@ -91,6 +94,7 @@ public function __construct(
\Magento\Framework\Filter\FilterManager $filterManager,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
LockGuardedCacheLoader $lockQuery,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\View\FileSystem $viewFileSystem,
\Magento\Framework\View\TemplateEnginePool $enginePool,
Expand Down Expand Up @@ -125,6 +129,7 @@ public function __construct(
$filterManager,
$localeDate,
$inlineTranslation,
$lockQuery,
$filesystem,
$viewFileSystem,
$enginePool,
Expand Down
29 changes: 29 additions & 0 deletions app/code/Magento/Catalog/Block/Product/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/
namespace Magento\Catalog\Block\Product;

use Magento\Framework\Cache\LockGuardedCacheLoader;

/**
* Constructor modification point for Magento\Catalog\Block\Product\AbstractProduct.
*
Expand Down Expand Up @@ -104,6 +106,7 @@ class Context extends \Magento\Framework\View\Element\Template\Context
* @param \Magento\Framework\Filter\FilterManager $filterManager
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation
* @param LockGuardedCacheLoader $lockQuery
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\View\FileSystem $viewFileSystem
* @param \Magento\Framework\View\TemplateEnginePool $enginePool
Expand Down Expand Up @@ -145,6 +148,7 @@ public function __construct(
\Magento\Framework\Filter\FilterManager $filterManager,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
LockGuardedCacheLoader $lockQuery,
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\View\FileSystem $viewFileSystem,
\Magento\Framework\View\TemplateEnginePool $enginePool,
Expand Down Expand Up @@ -196,6 +200,7 @@ public function __construct(
$filterManager,
$localeDate,
$inlineTranslation,
$lockQuery,
$filesystem,
$viewFileSystem,
$enginePool,
Expand All @@ -208,6 +213,8 @@ public function __construct(
}

/**
* Get Stock registry.
*
* @return \Magento\CatalogInventory\Api\StockRegistryInterface
*/
public function getStockRegistry()
Expand All @@ -216,6 +223,8 @@ public function getStockRegistry()
}

/**
* Get cart helper.
*
* @return \Magento\Checkout\Helper\Cart
*/
public function getCartHelper()
Expand All @@ -224,6 +233,8 @@ public function getCartHelper()
}

/**
* Get catalog config.
*
* @return \Magento\Catalog\Model\Config
*/
public function getCatalogConfig()
Expand All @@ -232,6 +243,8 @@ public function getCatalogConfig()
}

/**
* Get catalog helper.
*
* @return \Magento\Catalog\Helper\Data
*/
public function getCatalogHelper()
Expand All @@ -240,6 +253,8 @@ public function getCatalogHelper()
}

/**
* Get compare product.
*
* @return \Magento\Catalog\Helper\Product\Compare
*/
public function getCompareProduct()
Expand All @@ -248,6 +263,8 @@ public function getCompareProduct()
}

/**
* Get image helper.
*
* @return \Magento\Catalog\Helper\Image
*/
public function getImageHelper()
Expand All @@ -256,6 +273,8 @@ public function getImageHelper()
}

/**
* Get image builder.
*
* @return \Magento\Catalog\Block\Product\ImageBuilder
*/
public function getImageBuilder()
Expand All @@ -264,6 +283,8 @@ public function getImageBuilder()
}

/**
* Get math random.
*
* @return \Magento\Framework\Math\Random
*/
public function getMathRandom()
Expand All @@ -272,6 +293,8 @@ public function getMathRandom()
}

/**
* Get registry.
*
* @return \Magento\Framework\Registry
*/
public function getRegistry()
Expand All @@ -280,6 +303,8 @@ public function getRegistry()
}

/**
* Get tax data.
*
* @return \Magento\Tax\Helper\Data
*/
public function getTaxData()
Expand All @@ -288,6 +313,8 @@ public function getTaxData()
}

/**
* Get wishlist helper.
*
* @return \Magento\Wishlist\Helper\Data
*/
public function getWishlistHelper()
Expand All @@ -296,6 +323,8 @@ public function getWishlistHelper()
}

/**
* Get review renderer.
*
* @return \Magento\Catalog\Block\Product\ReviewRendererInterface
*/
public function getReviewRenderer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
namespace Magento\CatalogInventory\Model;

use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Framework\Search\EngineResolverInterface;
use Magento\Search\Model\EngineResolver;

/**
* Catalog inventory module plugin
Expand All @@ -20,21 +18,13 @@ class AddStockStatusToCollection
*/
protected $stockHelper;

/**
* @var EngineResolverInterface
*/
private $engineResolver;

/**
* @param \Magento\CatalogInventory\Helper\Stock $stockHelper
* @param EngineResolverInterface $engineResolver
*/
public function __construct(
\Magento\CatalogInventory\Helper\Stock $stockHelper,
EngineResolverInterface $engineResolver
\Magento\CatalogInventory\Helper\Stock $stockHelper
) {
$this->stockHelper = $stockHelper;
$this->engineResolver = $engineResolver;
}

/**
Expand All @@ -47,9 +37,7 @@ public function __construct(
*/
public function beforeLoad(Collection $productCollection, $printQuery = false, $logQuery = false)
{
if ($this->engineResolver->getCurrentSearchEngine() === EngineResolver::CATALOG_SEARCH_MYSQL_ENGINE) {
$this->stockHelper->addIsInStockFilterToCollection($productCollection);
}
$this->stockHelper->addIsInStockFilterToCollection($productCollection);
return [$printQuery, $logQuery];
}
}
92 changes: 0 additions & 92 deletions app/code/Magento/CatalogInventory/Model/Plugin/Layer.php

This file was deleted.

Loading

0 comments on commit 9ab466d

Please sign in to comment.