Skip to content

Commit f229cb3

Browse files
committed
MAGETWO-95294: Mysql search slow on the catalog page
- changes after CR
1 parent 44cb4d3 commit f229cb3

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ public function setOrder($attribute, $dir = Select::SQL_DESC)
266266
*/
267267
public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
268268
{
269-
/** This changes need in BIC reasons for support dynamic improved algorithm for price aggregation process. */
269+
/**
270+
* This changes need in backward compatible reasons for support dynamic improved algorithm
271+
* for price aggregation process.
272+
*/
270273
if ($this->isCurrentEngineMysql()) {
271274
parent::addCategoryFilter($category);
272275
} else {
@@ -282,7 +285,10 @@ public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
282285
*/
283286
public function setVisibility($visibility)
284287
{
285-
/** This changes need in BIC reasons for support dynamic improved algorithm for price aggregation process. */
288+
/**
289+
* This changes need in backward compatible reasons for support dynamic improved algorithm
290+
* for price aggregation process.
291+
*/
286292
if ($this->isCurrentEngineMysql()) {
287293
parent::setVisibility($visibility);
288294
} else {
@@ -391,6 +397,7 @@ private function getSearchResultApplier(SearchResultInterface $searchResult): Se
391397
return $this->searchResultApplierFactory->create([
392398
'collection' => $this,
393399
'searchResult' => $searchResult,
400+
/** This variable sets by serOrder method, but doesn't have a getter method. */
394401
'orders' => $this->_orders
395402
]);
396403
}

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ private function getSearchResultApplier(SearchResultInterface $searchResult): Se
509509
return $this->searchResultApplierFactory->create([
510510
'collection' => $this,
511511
'searchResult' => $searchResult,
512+
/** This variable sets by serOrder method, but doesn't have a getter method. */
512513
'orders' => $this->_orders,
513514
]);
514515
}
@@ -584,7 +585,10 @@ public function getFacetedData($field)
584585
public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
585586
{
586587
$this->addFieldToFilter('category_ids', $category->getId());
587-
/** This changes need in BIC reasons for support dynamic improved algorithm for price aggregation process. */
588+
/**
589+
* This changes need in backward compatible reasons for support dynamic improved algorithm
590+
* for price aggregation process.
591+
*/
588592
if ($this->isCurrentEngineMysql()) {
589593
parent::addCategoryFilter($category);
590594
} else {
@@ -603,7 +607,10 @@ public function addCategoryFilter(\Magento\Catalog\Model\Category $category)
603607
public function setVisibility($visibility)
604608
{
605609
$this->addFieldToFilter('visibility', $visibility);
606-
/** This changes need in BIC reasons for support dynamic improved algorithm for price aggregation process. */
610+
/**
611+
* This changes need in backward compatible reasons for support dynamic improved algorithm
612+
* for price aggregation process.
613+
*/
607614
if ($this->isCurrentEngineMysql()) {
608615
parent::setVisibility($visibility);
609616
}

0 commit comments

Comments
 (0)