Guest Posted September 21, 2003 Share Posted September 21, 2003 Hello folks, A shame, I found a great contributions here, Search Enhancement by Paul Whiter. What is basically does is store all searches your visitor makes and by analysing this data you can add 'were you looking for/ did you mean... X' when the search results come up. Unfortunately, it doesn't seem to be compatible with 2.2 MS2. Has anyone found a work-around or whatever? Quote Link to comment Share on other sites More sharing options...
JakobHK Posted September 22, 2003 Share Posted September 22, 2003 Hello WillemB Indeed a great contribution. A few changes is needed in order to make the module work with MS2. I am working on updating the module for MS2 and is uploading the updated module today. Best regards Jakob Quote Best regards Jakob Høy Biegel ----------------------------------- Shopeon.com - Automate your webshop Link to comment Share on other sites More sharing options...
JakobHK Posted September 22, 2003 Share Posted September 22, 2003 Hello The updated contribution is available at: http://www.oscommerce.com/community/contributions,1266 I have a suggestion: 7) When searching, any keywords entered as a plural will automatically have the final 's' stripped from the keyword, this should help if you have your products named/described in the singular form. A benefit of this is that even if there *should* be an 's' on the end of the keyword the correct results will be brought up due to the in-built partial matching of the osC search facility. A final 's' is used for plural phrases in english, but this is not used in all langauges (in danish, a final 'er' is used to indicate a plural phrase). Anyone interested in extending the module to support multiple language for plural search phrases? Jakob Quote Best regards Jakob Høy Biegel ----------------------------------- Shopeon.com - Automate your webshop Link to comment Share on other sites More sharing options...
Guest Posted September 22, 2003 Share Posted September 22, 2003 Thanks Jakob, I will test this out tonight! Thanks a bunch for your efforts. Regards, Willem. p.s. I don't think the final 's' thing is a good idea (certainly not for non-english languages, but neither for english), so I will simply take it out myself. Don't you just love tweaking and hacking and modifying :D Quote Link to comment Share on other sites More sharing options...
Guest Posted September 22, 2003 Share Posted September 22, 2003 Well I'm back Jakob and I have tested your code. Overall I can only say, congratulations, it works :D There are minor issues that need to be resolved though, it doesn't work right out of the box. Here's the details: The original documentation needs to be changed. There are still references to files/code that have changed. Here's number one: FIND: $breadcrumb->add(NAVBAR_TITLE1, tep_href_link(FILENAME_ADVANCED_SEARCH)); $breadcrumb->add(NAVBAR_TITLE2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $HTTP_GET_VARS['keywords'] . '&search_in_description=' . $HTTP_GET_VARS['search_in_description'] . '&categories_id=' . $HTTP_GET_VARS['categories_id'] . '&inc_subcat=' . $HTTP_GET_VARS['inc_subcat'] . '&manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&pfrom=' . $HTTP_GET_VARS['pfrom'] . '&pto=' . $HTTP_GET_VARS['pto'] . '&dfrom=' . $HTTP_GET_VARS['dfrom'] . '&dto=' . $HTTP_GET_VARS['dto'])); ?> This code no longer exists. Number 2: 6) admin/includes/application_top.php FIND: // define the filenames used in the project Below ADD: define('FILENAME_KEYWORDS', 'stats_keywords.php'); In MS2 this should not be application_top.php but filenames.php. Another issue is much more important. You seem to have made a little coding mistake. Here's your original code: // Search enhancement mod start $search_enhancements_keywords = $_GET['keywords']; $search_enhancements_keywords = strip_tags($search_enhancements_keywords); $search_enhancements_keywords = addslashes($search_enhancements_keywords); if ($search_keywords != $last_search_insert) { tep_db_query("insert into search_queries (search_text) values ('" . $search_keywords . "')"); tep_session_register('last_search_insert'); $last_search_insert = $search_keywords; } // Search enhancement mod end This is the correct code: // Search enhancement mod start $search_enhancements_keywords = $_GET['keywords']; $search_enhancements_keywords = strip_tags($search_enhancements_keywords); $search_enhancements_keywords = addslashes($search_enhancements_keywords); if ($search_enhancements_keywords != $last_search_insert) { tep_db_query("insert into search_queries (search_text) values ('" . $search_enhancements_keywords . "')"); tep_session_register('last_search_insert'); $last_search_insert = $search_enhancements_keywords; } // Search enhancement mod end Notice how you mix up $search_keywords and $search_enhancements_keywords? Without the correct code it would obviously not work, but a newbie would probably not find the mistake. Anyway I'm happy with this new addition and in a way I'm glad I was able to catch some mistakes... this kind of stuff happens to me quite often and it's nice to finally catch someone else doing the same thing :P Again, thanks a lot! Regards, Willem Quote Link to comment Share on other sites More sharing options...
JakobHK Posted September 23, 2003 Share Posted September 23, 2003 Hello WillemB Thank you very much for testing the updated contribution. :wacko: My mistake about the 3 errors you found. It seems like I was a little to lazy when updating the readme-file. A fixed contribution will be available very soon. Best regards Jakob Quote Best regards Jakob Høy Biegel ----------------------------------- Shopeon.com - Automate your webshop Link to comment Share on other sites More sharing options...
Guest Posted October 3, 2003 Share Posted October 3, 2003 Good thing i found this thread before i posted up. Was getting some strage "array" keyword and didnt make any sense to me and started to go over the coding input right when i found the early fix here. Excellent mod and works well with ms2 now. Quote Link to comment Share on other sites More sharing options...
crash3903 Posted October 13, 2003 Share Posted October 13, 2003 I have installed the search enhancement and I have this question I want to add a bulk upload of keywords into the database - what table do i put this into and also when does the search correct the search phrase i.e. your search returnded no results did you mean...x Or does this do things itself?? thnaks and regards Mark Quote Regards Mark A Reynolds Link to comment Share on other sites More sharing options...
Guest Posted October 25, 2003 Share Posted October 25, 2003 You must help!! I just get a plain page, nothing happens! I have a live store! but the search is totally down... please help. www.alternateclothing.com The search box is at the top. Quote Link to comment Share on other sites More sharing options...
Guest Posted October 25, 2003 Share Posted October 25, 2003 oh no! never mind, lol. I feel such a tool, one of the comment lines only had one / so instead of //comment it was /comment DUH! Quote Link to comment Share on other sites More sharing options...
Guest Posted October 25, 2003 Share Posted October 25, 2003 Hehe valuable lesson... try it on your sandbox website locally first :) Quote Link to comment Share on other sites More sharing options...
Guest Posted October 25, 2003 Share Posted October 25, 2003 Yeah, lesson learned. Damn me and my confidence. lol. Quote Link to comment Share on other sites More sharing options...
paulm2003 Posted October 31, 2003 Share Posted October 31, 2003 Wouldn't it be nice to add the levenshtein function to the Search Enhancement contribution? http://www.php.net/manual/en/function.levenshtein.php For fuzzy search. It returns the "Levenshtein-Distance" between two strings. Quote Link to comment Share on other sites More sharing options...
chfields Posted October 31, 2003 Share Posted October 31, 2003 I just installed this and get this error Fatal error: Cannot pass parameter 3 by reference in /home/mrsfield/public_html/includes/modules/product_listing.php on line 23 Any help please?? Quote Link to comment Share on other sites More sharing options...
chfields Posted October 31, 2003 Share Posted October 31, 2003 this is for MS1 Quote Link to comment Share on other sites More sharing options...
chfields Posted October 31, 2003 Share Posted October 31, 2003 Problem solved Quote Link to comment Share on other sites More sharing options...
arthurema Posted November 10, 2003 Share Posted November 10, 2003 Great Contrib and thanks so much. I have a suggestion and quesion. Could someone help me to build this? I would like to enter a * or blank in the search box and have it return the result page listing all keywords as select boxes. In the admin interface, I add the term * corresponding to a list of all the unique words that are in the descriptions fileds of all the products. With large lists of unique words, I would split them up into multiple lines using *, **, ***, etc. Currently, not entering a search term, or leaving the field blank, will display all products. Quote Link to comment Share on other sites More sharing options...
arthurema Posted November 21, 2003 Share Posted November 21, 2003 Is there anyone recieving new posts to this topic? Any ideas on how to assist me? Thank you. Quote Link to comment Share on other sites More sharing options...
JakobHK Posted December 15, 2003 Share Posted December 15, 2003 Great Contrib and thanks so much. I have a suggestion and quesion. Could someone help me to build this? I would like to enter a * or blank in the search box and have it return the result page listing all keywords as select boxes. As I understand your suggestion want to add new functionality to the contribution. Please fell free to extend it how your wish and upload it as an extended version. In the admin interface, I add the term * corresponding to a list of all the unique words that are in the descriptions fileds of all the products. With large lists of unique words, I would split them up into multiple lines using *, **, ***, etc. What is the purpose of adding all the unique words from product descriptions to the list of keywords??? As I understand the usage of the contribution, you only add the keywords, where you want the suggest an alternative keyword. Best regards Jakob Quote Best regards Jakob Høy Biegel ----------------------------------- Shopeon.com - Automate your webshop Link to comment Share on other sites More sharing options...
arthurema Posted December 15, 2003 Share Posted December 15, 2003 I actually do not want to add all keywords to checkboxes. Just a few main or common ones as defined over time by the statistics. This can be a manual process to define them. I am not interested in auto calculating the top 10 successful keyword search and displaying those as checkboxes. If I were to put the top 10 keywords in their own row in the keyword search/replace table, then build checkboxes off that row. The keyword for the row could be unique with an '*' and the replace field would be a space seperated list of the top 10. If an '*' is entered into the actual search field, then the result page would be invalid as it will show that no results were returned, and will display this space seperated row as a possible replacement to the search. I don't care about this issue. Or would you suggest another wayto do this? I appreciate you help. Quote Link to comment Share on other sites More sharing options...
JakobHK Posted December 18, 2003 Share Posted December 18, 2003 I think I understand a bit more. It sounds like a very specific use. It can be hard find someone to do this for you. My suggestion is: 1) Do it your selfself or pay someone to do it. 2) Post your request in "Suggestions and Proposals" and see if someone capable of programming it, also have the need for it, and therefore want to make it. Best regards Jakob Quote Best regards Jakob Høy Biegel ----------------------------------- Shopeon.com - Automate your webshop Link to comment Share on other sites More sharing options...
willross Posted December 21, 2003 Share Posted December 21, 2003 I am using MS2 and am getting the same error that an earlier poster mentioned. Here it is: Fatal error: Cannot pass parameter 3 by reference in /home/palaia/public_html/shop/includes/modules/product_listing.php on line 23 What is the fix? Quote · willross ·········· Link to comment Share on other sites More sharing options...
willross Posted December 22, 2003 Share Posted December 22, 2003 OK, I found the problem and fixed it. This is what I did to solve it: I wrote this: $listing_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $listing_sql, $listing_numrows); Instead of this: $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); I hope this helps anyone else that encounters this error. Quote · willross ·········· Link to comment Share on other sites More sharing options...
Guest Posted January 19, 2004 Share Posted January 19, 2004 Hi, Thanks for this great contrib, its providing some useful data. I have just one problem. If someone enters a search with an apostrophe ie "don't" I get an SQL error when I try to update from raw data - move from search_queries to search_queries_sorted. Any ideas how I fix this? Just one other minor thing. In admin, the list of search terms have links to what the site returned for that search (great idea!). This link opens (correctly) a new page but also transfers the existing page from admin to the search term in the catalog. Thanks, Ian Quote Link to comment Share on other sites More sharing options...
diamich Posted January 24, 2004 Share Posted January 24, 2004 I'm hoping someone can help me out here. I'm totally new to osCommerce and PHP illiterate, so it's like fumbling around in the dark for what is producing my error with this Search Enhancement. I've installed the latest download of the Search Enhancement into osCommerce 2.2-MS2 and I get this error: Fatal error: Call to undefined function: tep_session_register() in /home/luv2shop/public_html/uwill/catalog/advanced_search_result.php on line 180 I'm running PHP Version 4.3.3 and changed the $_GET to $HTTP_GET_VARS after getting the error message and still it made no difference. Can someone please tell me what I'm doing wrong? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.