Skip to content

Commit

Permalink
Improve global search performance by using only prefix matching.
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour committed Apr 4, 2023
1 parent 7452240 commit 8f2f022
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions app/code/core/Mage/Adminhtml/Model/Search/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ public function load()
['attribute' => 'billing_firstname', 'like' => $query . '%'],
['attribute' => 'billing_lastname', 'like' => $query . '%'],
['attribute' => 'billing_telephone', 'like' => $query . '%'],
['attribute' => 'billing_postcode', 'like' => $query . '%'],

['attribute' => 'shipping_firstname', 'like' => $query . '%'],
['attribute' => 'shipping_lastname', 'like' => $query . '%'],
['attribute' => 'shipping_telephone', 'like' => $query . '%'],
['attribute' => 'shipping_postcode', 'like' => $query . '%'],
])
->setCurPage($this->getStart())
->setPageSize($this->getLimit())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function _getSearchEntityIdsSql($query)

/** @var Mage_Core_Model_Resource_Helper_Abstract $resHelper */
$resHelper = Mage::getResourceHelper('core');
$likeOptions = ['position' => 'any'];
$likeOptions = ['position' => 'start'];

/**
* Collect tables and attribute ids of attributes with string values
Expand Down

0 comments on commit 8f2f022

Please sign in to comment.