Skip to content

Commit feb7a67

Browse files
author
Stanislav Idolov
authored
ENGCOM-1910: Fulltext replacement with like condition #15685
2 parents 8481ab0 + 0af0025 commit feb7a67

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/FilterProcessor.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ private function addFilterGroupToCollection(
7272
if (!$isApplied) {
7373
$condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq';
7474
$fields[] = $this->getFieldMapping($filter->getField());
75+
76+
if ($condition === 'fulltext') {
77+
// NOTE: This is not a fulltext search, but the best way to search something when
78+
// a SearchCriteria with "fulltext" condition is provided over a MySQL table
79+
// (see https://github.com/magento-engcom/msi/issues/1221)
80+
$condition = 'like';
81+
$filter->setValue('%' . $filter->getValue() . '%');
82+
}
83+
7584
$conditions[] = [$condition => $filter->getValue()];
7685
}
7786
}

0 commit comments

Comments
 (0)