Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search Enhancement by Paul Whiter... MS2 ???


Guest

Recommended Posts

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?

Link to comment
Share on other sites

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

Best regards

Jakob Høy Biegel

-----------------------------------

Shopeon.com - Automate your webshop

Link to comment
Share on other sites

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

Best regards

Jakob Høy Biegel

-----------------------------------

Shopeon.com - Automate your webshop

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Best regards

Jakob Høy Biegel

-----------------------------------

Shopeon.com - Automate your webshop

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...

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

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
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

Best regards

Jakob Høy Biegel

-----------------------------------

Shopeon.com - Automate your webshop

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Best regards

Jakob Høy Biegel

-----------------------------------

Shopeon.com - Automate your webshop

Link to comment
Share on other sites

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.

· willross

··········

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...