magento2: Catalog Search module search with parenthesis breaks the site.
Preconditions (*)
- Magento 2.3.1
Steps to reproduce (*)
- Enable Elastic Search
- append ‘/catalogsearch/result/?q=%28%28%28%28’ to url. Ex: site.com/catalogsearch/result/?q=%28%28%28%28
- The site will return a error.
Expected result (*)
- Should not have any errors.
Actual result (*)
2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected $end, query was: SELECT search_synonyms.* FROM search_synonyms WHERE (MATCH (synonyms) AGAINST (‘\(’ IN BOOLEAN MODE))
Exception #1 (PDOException): SQLSTATE[42000]: Syntax error or access violation: 1064 syntax error, unexpected $end
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 29 (13 by maintainers)
Steps to reproduce (*) Enable Elastic Search append ‘/catalogsearch/result/?q=%28%28%28%28’ to url. Ex: site.com/catalogsearch/result/?q=%28%28%28%28 The site will return a error.
The reason why Magento2.3.2 works is because it skips the search when it is less than 3 characters.
It seems like this commit fixed the issue
https://github.com/magento/magento2/commit/ec7015017b1e0c27c161fa62b1ead3a6367271e8
Alright. I will look into it. Thanks!