grasnal Posted December 28, 2010 Share Posted December 28, 2010 Hello. Did anybody managed to force "simple search module" to make full text search? For example:query: SATAresult: eSATAIf anyone know free search module better than provided by Presta i will be thankfully if you point me it. Link to comment Share on other sites More sharing options...
grasnal Posted December 30, 2010 Author Share Posted December 30, 2010 Can someone confirm that PrestaShop do not return positive search match if a searched string is a sub string of longer one? For example if I search for: "TB ST3" i want to find item with name "HDD SEAGATE 1TB ST31000528AS SATA II 32MB".Maybe I messed something? Link to comment Share on other sites More sharing options...
dave7x7 Posted December 31, 2010 Share Posted December 31, 2010 yeah i need to know too Link to comment Share on other sites More sharing options...
rocky Posted December 31, 2010 Share Posted December 31, 2010 I can confirm that PrestaShop doesn't search substrings for performance reasons. It only indexes starting from the first x characters (the minimum word length on the Preferences > Search tab). Link to comment Share on other sites More sharing options...
grasnal Posted January 4, 2011 Author Share Posted January 4, 2011 I made "quick&dirty;" hack to force PrestaShop search sub string through at least product name.This do not check product is active/inactive and visitor access right to list product (user groups). I don't have any idea is this safe at all. But it works .@rocky: can you help me solve above disadvantagesPrrestaShop version: 1.3.3file: classes/Search.phpline: 185change from: $eligibleProducts = $db->ExecuteS(' SELECT DISTINCT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = cg.`id_category` INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category` INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` WHERE c.`active` = 1 AND p.`active` = 1 AND cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN ( SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).' )').' AND '.implode(' AND ', $whereArray)); to $eligibleProducts = $db->ExecuteS(' SELECT id_product FROM '._DB_PREFIX_.'product_lang WHERE id_lang = '.intval($id_lang).' AND name LIKE \'%'.$expr.'%\' UNION SELECT DISTINCT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg INNER JOIN `'._DB_PREFIX_.'category_product` cp ON cp.`id_category` = cg.`id_category` INNER JOIN `'._DB_PREFIX_.'category` c ON cp.`id_category` = c.`id_category` INNER JOIN `'._DB_PREFIX_.'product` p ON cp.`id_product` = p.`id_product` WHERE c.`active` = 1 AND p.`active` = 1 AND cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN ( SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).' )').' AND '.implode(' AND ', $whereArray)); added statment: SELECT id_product FROM '._DB_PREFIX_.'product_lang WHERE id_lang = '.intval($id_lang).' AND name LIKE \'%'.$expr.'%\'UNION Link to comment Share on other sites More sharing options...
seniz Posted March 9, 2011 Share Posted March 9, 2011 is there any solution for PrestaShop Version 1.3.7.0 ? Link to comment Share on other sites More sharing options...
culex Posted March 10, 2011 Share Posted March 10, 2011 Thank you very much @grasnal for the code, is very usefulis there any way to search only in active products?not on the active/inactive products Link to comment Share on other sites More sharing options...
SkyHiRider Posted August 25, 2011 Share Posted August 25, 2011 How can I make this work on version 1.4.4 ? Link to comment Share on other sites More sharing options...
SkyHiRider Posted August 30, 2011 Share Posted August 30, 2011 I've edited Search.php and added the modified sql querry, but the search still doesn't work as expected (finds t4915 but does not find 4915). I've even tried restarting apache for the changes to take effect. What should I do to make it work? Link to comment Share on other sites More sharing options...
SkyHiRider Posted August 30, 2011 Share Posted August 30, 2011 -double post, sorry- Link to comment Share on other sites More sharing options...
RybtsovSergey Posted April 7, 2012 Share Posted April 7, 2012 Try to insert $word ='%'.$word.'%'; after $word = str_replace('%', '\\%', $word); $word = str_replace('_', '\\_', $word); String number 175. It seems to be work. Prestashop 1.4.7. 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