Skip to content

Commit 247ecc6

Browse files
committed
AC-14360: Admin orders - unable to search for Will
1 parent dbd1684 commit 247ecc6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/code/Magento/Sales/Plugin/SearchCriteria/FulltextFilterPlugin.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ class FulltextFilterPlugin
1616
{
1717

1818
/**
19-
* For the sales order grid only, replace MATCH AGAINST with LIKE across key columns
20-
* to avoid MySQL stopword issues
19+
* Use LIKE instead of MATCH AGAINST in sales order grid to bypass MySQL stopword limitations
2120
*
2221
* @param UiFulltextFilter $subject
2322
* @param \Closure $proceed
2423
* @param Collection $collection
2524
* @param Filter $filter
2625
* @return void
26+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2727
*/
2828
public function aroundApply(
2929
UiFulltextFilter $subject,
@@ -36,6 +36,14 @@ public function aroundApply(
3636
if ($value === '') {
3737
return;
3838
}
39+
40+
if (preg_match('/^\{+\s*(\d+)\s*\}+$/', $value, $m)) {
41+
$term = $m[1];
42+
$collection->addFieldToFilter('increment_id', ['eq' => $term]);
43+
return;
44+
}
45+
46+
$value = trim($value, '{}');
3947
$like = '%' . str_replace(['%', '_'], ['\\%', '\\_'], $value) . '%';
4048

4149
$fields = ['increment_id', 'billing_name', 'shipping_name', 'customer_email'];

0 commit comments

Comments
 (0)