chipset Posted September 12, 2013 Share Posted September 12, 2013 (edited) Hello, I noticed that there is a problem with finding. I have a new installation, without added modules if you write in the search box "ipod", the result is: "5 results have been found." But if you write "pod", the result is: "No results were found for your search "pod""Is it just me have this problem and how to solve it? p.s. In the admin panel, searching box working fine. Thanks Edited September 12, 2013 by chipset (see edit history) Link to comment Share on other sites More sharing options...
chipset Posted September 12, 2013 Author Share Posted September 12, 2013 Does not anyone see a problem with that or just to me is wrong? I thing so this is very serious problem Link to comment Share on other sites More sharing options...
NemoPS Posted September 13, 2013 Share Posted September 13, 2013 Hi! This is because pod is not indexed as a search word. You can use aliases for that (preferences->search). If you want, however, you can slightly edit the search class to allow searching inside keywords. THis will, however, slow down the search process a bit (depending on your server's performance) Link to comment Share on other sites More sharing options...
chipset Posted September 13, 2013 Author Share Posted September 13, 2013 Thanks for the reply Nemo1. Options with aliases may be working at the store with 10 items, but if you have 1000 +?In preferentses wrote that I have 7/7 indexed. For each case, Re-build the entire index, but still do not find the word "pod".I tried different weight, but the problem is not in the speed or arrangement, just finds nothing. How search in the admin panel finds all? Can I use it in front? Link to comment Share on other sites More sharing options...
NemoPS Posted September 14, 2013 Share Posted September 14, 2013 If you want to go for the modification, reach line 185 (about), of classes/Search.php, you'll see this $intersect_array[] = 'SELECT si.id_product FROM '._DB_PREFIX_.'search_word sw LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word WHERE sw.id_lang = '.(int)$id_lang.' AND sw.id_shop = '.$context->shop->id.' AND sw.word LIKE '.($word[0] == '-' ? ' \''.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' ); Change it to $intersect_array[] = 'SELECT si.id_product FROM '._DB_PREFIX_.'search_word sw LEFT JOIN '._DB_PREFIX_.'search_index si ON sw.id_word = si.id_word WHERE sw.id_lang = '.(int)$id_lang.' AND sw.id_shop = '.$context->shop->id.' AND sw.word LIKE '.($word[0] == '-' ? ' \'%'.pSQL(Tools::substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\'%'.pSQL(Tools::substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' ); As you can see I added a % sign at the beginning as well, this will have the search look for any occurrence of the string, instead of only the ones which begin with the given one 2 Link to comment Share on other sites More sharing options...
chipset Posted September 17, 2013 Author Share Posted September 17, 2013 ... you can see I added a % sign at the beginning as well, this will have the search look for any occurrence of the string, instead of only the ones which begin with the given one Thanx Nemo1, now it working perfect for me! Link to comment Share on other sites More sharing options...
nienha Posted November 28, 2013 Share Posted November 28, 2013 This should be an option to switch on and off in the backoffice. 1 Link to comment Share on other sites More sharing options...
Recommended Posts