Jack Posted November 11, 2018 Share Posted November 11, 2018 I cannot make search work in front end. After input some words and press enter, always no products found. Anyone else have the same issue using version 1.7.4.3? Link to comment Share on other sites More sharing options...
jetway Posted November 12, 2018 Share Posted November 12, 2018 No, works good for me. However, did you index your products? Link to comment Share on other sites More sharing options...
Jack Posted November 12, 2018 Author Share Posted November 12, 2018 Yes, I did everything I find online to make it work, but failed. Link to comment Share on other sites More sharing options...
Jack Posted November 12, 2018 Author Share Posted November 12, 2018 After re-installed prestashop, I found the search function just works for English words, not for Chinese words. Anyone has an idea to fix it? Link to comment Share on other sites More sharing options...
Jack Posted November 16, 2018 Author Share Posted November 16, 2018 Finally found the reason and a workaround: In classes/Search.php, in function sanitize() at about line 167, $string = Tools::replaceAccentedChars(trim(preg_replace('/\s+/', ' ', $string))); replace it with, $string = Tools::replaceAccentedChars($string); Then searching works with Chinese words. Notes: my version is 1.7.4.3 Link to comment Share on other sites More sharing options...
Jack Posted November 16, 2018 Author Share Posted November 16, 2018 Finally found the solution, just replace the line mentioned above with, $string = Tools::replaceAccentedChars(trim(preg_replace('/[\pZ\pC]+/u', ' ', $string))); Also, comment out lines about splitting symbols(also chinese characters) to single words, see attached file for details. Then rebuild search index and everything will work. Search.php Link to comment Share on other sites More sharing options...
David Posted November 21, 2018 Share Posted November 21, 2018 Instead of using PrestaShop default search I prefer to use the Search Module available at the Addon store. It provides more options to improve the search results, it works good for my store. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now