Don G. Posted March 29, 2010 Share Posted March 29, 2010 Hello, I am having some issues with my search, at least its not working the way I would like.We have a product The Torch Is Passed, we have it listed as Torch Is Passed, Thenow when i search for Is Passed I get no results but if i search for Passed i get results and the first one listed is in fact Torch Is Passed, The, Im also having issues with when you search for the normal title The Torch Is Passed I get no results, yet The is in the blocked and looks like punctuation is removed (looking in classes/search.php) so I would assume its searching for Torch Is Passed.So in all, the search is way to strict Quick ResultsTitle Torch Is Passed, TheNo results found for your search "The Torch Is Passed" No results found for your search "Torch Is Passed, The" No results found for your search "Torch Is Passed"No results found for your search "Is Passed" Passed - 3 resultsso far the only ways I can search for this product is searching Passed or as I type the Ajax Search finds it and works if i select it.I am also wanting to be able to search by the reference # or some other field because most people want to search by product number. Is there maybe a better search module?Thank in advance Don G. Link to comment Share on other sites More sharing options...
Don G. Posted March 29, 2010 Author Share Posted March 29, 2010 Just noticed that the demo site I can search for "nano" and i get 2 results iPod Nano Housse portefeuille en cuir...So it seems like it should be a little better then what mine is doing.Also I'm running Version 1.2.5.0 - 0.071s Link to comment Share on other sites More sharing options...
tomerg3 Posted March 29, 2010 Share Posted March 29, 2010 Could be that something got messed up with your index, try to rebuild it in the backoffice Tools->Search 1 Link to comment Share on other sites More sharing options...
Don G. Posted March 29, 2010 Author Share Posted March 29, 2010 Thanks for the reply.I tried that and still no good Indexed products: 1503 / 1503. Link to comment Share on other sites More sharing options...
Don G. Posted March 29, 2010 Author Share Posted March 29, 2010 I was looking through the search_words table and i see its indexed the words8120|1|torch3230|1|passed8474|1|passed,and in search_index9562|8120|69562|8474|6... bunch of other rows for words in the description Link to comment Share on other sites More sharing options...
Draco Posted March 30, 2010 Share Posted March 30, 2010 OK if you want the search to index "the" you will have to do 2 things:go to back office under Preferences tab --> Search1. remove "the" from the blacklisted words2. set Minimum word length option to "2"Then click on rebuild entire index, this should do it !! Link to comment Share on other sites More sharing options...
Don G. Posted March 31, 2010 Author Share Posted March 31, 2010 Its not so much that I want "The" to be searchable, its the fact that the only search term that gets the product mentioned is searching "passed" should match on more then one word. Link to comment Share on other sites More sharing options...
Don G. Posted April 5, 2010 Author Share Posted April 5, 2010 I really need some help here, as it is, the site is pretty much un-searchable and most of our customers would rather search then browse.I took some screen shots today, cause its just really acting strange.Also, is there a way to use the Admin search code for the from end? because the admin search works perfect, can do partial title searches, and even supp. Reference search (thats what most people want to search by)Thanks againDon G. Link to comment Share on other sites More sharing options...
Don G. Posted April 5, 2010 Author Share Posted April 5, 2010 Well I kinda fixed it by stealing the SQL from the admin search (Product::searchByName())Not sure what kind of issues this could cause so fixing the original search Query would be nicejust changed the $queryResults SQl to whats below and added the sanitize on $expr Edit should be around line 195 in classes/Search.php (did changes before noticing original line number) $query = Search::sanitize($expr, $id_lang); $queryResults = ' SELECT SQL_CALC_FOUND_ROWS p.*, pl.`description`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, t.`rate`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name '.$score.' FROM `'._DB_PREFIX_.'category_product` cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'tax` t ON t.`id_tax` = p.`id_tax` LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) AND i.`cover` = 1 LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).') WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' AND p.active = 1 GROUP BY `id_product` '.($orderBy ? 'ORDER BY '.$orderBy : '').($orderWay ? ' '.$orderWay : '').' LIMIT '.intval(($pageNumber - 1) * $pageSize).','.intval($pageSize); Link to comment Share on other sites More sharing options...
mark2 Posted April 10, 2010 Share Posted April 10, 2010 As Draco mentioned: set Minimum word length option to “2”Regards, Mark Link to comment Share on other sites More sharing options...
Don G. Posted April 13, 2010 Author Share Posted April 13, 2010 As Draco mentioned: set Minimum word length option to “2”Regards, Mark As yo can see in the images, Its already set to "2" Link to comment Share on other sites More sharing options...
eGzyl.pl Posted May 20, 2010 Share Posted May 20, 2010 i want ask about ajax serach and search in BO. when i put numer in BO search E1234 show my produkt with name/reference e1234 when i put 1234 result is the same ( show me product E1234) . when im in FO and put 1234 in ajax serach dont have result with this product who have name/reference E1234.is it a problem with regular expressions??somebody repair and have idea why in BO working good but in FO not : Link to comment Share on other sites More sharing options...
Sundoctor Posted June 17, 2011 Share Posted June 17, 2011 Well I kinda fixed it by stealing the SQL from the admin search (Product::searchByName())Not sure what kind of issues this could cause so fixing the original search Query would be nicejust changed the $queryResults SQl to whats below and added the sanitize on $expr Edit should be around line 195 in classes/Search.php (did changes before noticing original line number) $query = Search::sanitize($expr, $id_lang); $queryResults = ' SELECT SQL_CALC_FOUND_ROWS p.*, pl.`description`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`name`, t.`rate`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name '.$score.' FROM `'._DB_PREFIX_.'category_product` cp LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product` LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'tax` t ON t.`id_tax` = p.`id_tax` LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`) AND i.`cover` = 1 LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).') WHERE pl.`name` LIKE \'%'.pSQL($query).'%\' OR p.`reference` LIKE \'%'.pSQL($query).'%\' OR p.`supplier_reference` LIKE \'%'.pSQL($query).'%\' AND p.active = 1 GROUP BY `id_product` '.($orderBy ? 'ORDER BY '.$orderBy : '').($orderWay ? ' '.$orderWay : '').' LIMIT '.intval(($pageNumber - 1) * $pageSize).','.intval($pageSize); Thx Don G. it works like a charme, i will try to fix the org code now, to see what happend. 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