Hi all,
Does anyone know how I can remove symbols from search queries using Magento 2’s default MYSQL?
I want a temporary fix as I won’t get a chance to play around with Elasticsearch yet [I’ve heard this might be good at removing them or could help solve it.]
For now, I’ve found the following article, which explains what I want to do.
Customer searches for Test1$23?45&789^1 , but the website/database reads it as Test1 23 45 789 1
Match.php is located here:
vendor\magento\framework\Search\Adapter\Mysql\Query\Builder
Within Match.php, I’m assuming I turn this line:
const SPECIAL_CHARACTERS = '-+~/\\<>\'":*$#@()!,.?
=%&^’;`
into
const SPECIAL_CHARACTERS = ' ';
How would I override Match.php in my custom theme?
I want to do this to remove the ugly MYSQL injection suggestions our customers might see from the auto suggestion when searching.