ding Posted May 12, 2010 Share Posted May 12, 2010 hi,allHow can i search by product id?? Link to comment Share on other sites More sharing options...
rocky Posted May 12, 2010 Share Posted May 12, 2010 In the front office or the back office? Link to comment Share on other sites More sharing options...
ding Posted May 12, 2010 Author Share Posted May 12, 2010 thx, rockyin front office Link to comment Share on other sites More sharing options...
ding Posted May 12, 2010 Author Share Posted May 12, 2010 ha,i get it.classes/search.php replace $whereArray[] = ' p.id_product '.($word[0] == '-' ? 'NOT' : '').' IN ( SELECT 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 = '.intval($id_lang).' AND sw.word LIKE '.($word[0] == '-' ? ' \''.pSQL(substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'').' ) '; if ($word[0] != '-') $scoreArray[] = 'sw.word LIKE \''.pSQL(substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''; to if(intval($word)) { $whereArray[] = ' p.id_product = '.intval($word); }else{ $whereArray[] = ' p.id_product '.($word[0] == '-' ? 'NOT' : '').' IN ( SELECT 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 = '.intval($id_lang).' AND sw.word LIKE '.($word[0] == '-' ? ' \''.pSQL(substr($word, 1, PS_SEARCH_MAX_WORD_LENGTH)).'%\'' : '\''.pSQL(substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\'').' ) '; if ($word[0] != '-') $scoreArray[] = 'sw.word LIKE \''.pSQL(substr($word, 0, PS_SEARCH_MAX_WORD_LENGTH)).'%\''; } Link to comment Share on other sites More sharing options...
BillyD Posted May 23, 2010 Share Posted May 23, 2010 Hi Guys,I would like to populate my Search_word and search_index on "Category description" rather than "Category name"?I can see the indexation function in the classes\search.php and have changed SELECT p.id_product, pl.id_lang, pl.name as pname, p.reference, p.ean13, pl.description_short, pl.description, cl.name as cname, m.name as mname To SELECT p.id_product, pl.id_lang, pl.name as pname, p.reference, p.ean13, pl.description_short, pl.description, cl.description as cname, m.name as mname is there anything else I need to do as this appears to work? Link to comment Share on other sites More sharing options...
Recommended Posts