Contributions
Search Enhancements
Search Enhancements - For MS1 and later
1) Automatic logging of all search terms used on your site.
2) Processing of logged search terms into total counts, with sorting by totals or by name.
3) Admin page provides a Google type facility whereby you can add words or phrases and their suggested replacements to a database table, once you've added data to this table if for example a customer searches for 'wheal' a line is added to the top of the search results page saying: 'you could also try: wheel'. This line is a clickable link that automatically re-searches on the replacement words. For this feature to work you must have made an entry via the admin page for the particular word/phrase used as well as the suggested replacement, obviously this data will take a little time to build up, this is the reason for the keyword logging, so as you can periodically check to see what needs adding to the replacements table.
4) Words/phrases and their suggested replacements can be added/edited/deleted at any time via the admin section.
5) Improved layout of Search results page if no results are found, providing the user with some tips on better searching.
6) Complete admin section to view and process logged search results.
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.
Expand All / Collapse All
Search Unenhancements
There are times when tracking search keywords is undesireable.
Rather than replacing the file:
'/catalog/advanced_search_result.php'
Rename it to:
'/catalog/advanced_search_result_notally.php' and reference it instead.
This is great if you want to embed into a product description a pre-composed search link for other products in a series, or email a pre-composed search link in an email to a client , and don't want the pre-composed search to count in the totals.
Example:
<a href="http://your.website.here/catalog/advanced_search_result.php?keywords=search_term+another_search_term&x=0&y=0" title="Search for other items in the same series">Check out other models in the same series.</a>
Since I employ a standard for naming products, I can search for specific unique phrases, such as "Tele Vue Ethos" without worry of other un-related products appearing in the listing. To do this, simply separate search words with a plus sign, as in my example.
Perhaps some day I'll generate an add-on to make creating these pre-composed search links easier to author. There is probably a contribution that presents related or similar products to visitors, but this was quick-and-dirty.
Thanks to everyone involved in Search Enhancements. I think it's one of the best add-ons, and should be incorporated into the next version.
modified this section in the admin/stats_keywords.php file to have addslashes around the search_text.
also deleting search_text one by one in the while loop
if ($_GET['update'] == BUTTON_UPDATE_WORD_LIST) {
$sql_q = tep_db_query("SELECT DISTINCT search_text, COUNT(*) AS ct FROM search_queries GROUP BY search_text");
while ($sql_q_result = tep_db_fetch_array($sql_q)) {
$update_q = tep_db_query("select search_text, search_count from search_queries_sorted where search_text = '" . addslashes($sql_q_result['search_text']) . "'");
$update_q_result = tep_db_fetch_array($update_q);
$count = $sql_q_result['ct'] + $update_q_result['search_count'];
if ($update_q_result['search_count'] != '') {
tep_db_query("update search_queries_sorted set search_count = '" . $count . "' where search_text = '" . addslashes($sql_q_result['search_text']) . "'");
} else {
tep_db_query("insert into search_queries_sorted (search_text, search_count) values ('" .
addslashes($sql_q_result['search_text']) . "'," . $count . ")");
} // search_count
tep_db_query("delete from search_queries where search_text = '" . addslashes($sql_q_result['search_text']) ."'");
} // while
} // updatedb
full package atta
Checkbox for "Search in Product Description" is not working
URL shows search_in_description=on
<br>
example <br>
http://www.abundalife.com/catalog/advanced_search_result.php?keywords=glutamine&search_in_description=on&x=57&y=15&categories_id=&inc_subcat=1&manufacturers_id=&pfrom=&pto=&dfrom=&dto=
<br><br>
thus line 330 in page advanced_search_result.php needs to be changed to this: <br><br>
if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == 'on'))
Tom Stickel
Abundalife.com
Fixes the search completely now and corrects one more place the 's' was missing.
UPGRADERS from 1.x:
Just overwrite the old code in advanced_search_result.php and english/advanced_search.php
Fixes the search completely now and corrects one more place the 's' was missing.
UPGRADERS from 1.x:
Just overwrite the old code in advanced_search_result.php and english/advanced_search.php
- Update to fix bug where if you had one term in admin keywords and it's exact opposite listed it would give you the same search term back. For example if I had dog = cat and then cat = dog in my backend and I search for dog I would get dog again. Now this has been fixed.
- Update to modify the text displayed after a search and to add back the 's' for the customer to see if it was taken off for the search. (cosmetic only, it still searches for terms without the 's')
TO UPDATE:
Just overwrite the old code in advanced_search_result.php and english/advanced_search.php
FORUM:
http://forums.oscommerce.com/index.php?showtopic=59309
Tested on osCommerce 2.2 Milestone 2 Update 051113
A few bugs in the readme file have been corrected
This is an updated version of the Search Enhancements Module for MS2. No other changes are made to the module
All credit for this contribution goes to the original author: Paul Whiter, who wrote this contribution
Please post any questions/comments for this update in osc forum: http://forums.oscommerce.com/index.php?showtopic=59309
Search Enhancements - For MS1 and later
1) Automatic logging of all search terms used on your site.
2) Processing of logged search terms into total counts, with sorting by totals or by name.
3) Admin page provides a Google type facility whereby you can add words or phrases and their suggested replacements to a database table, once you've added data to this table if for example a customer searches for 'wheal' a line is added to the top of the search results page saying: 'you could also try: wheel'. This line is a clickable link that automatically re-searches on the replacement words. For this feature to work you must have made an entry via the admin page for the particular word/phrase used as well as the suggested replacement, obviously this data will take a little time to build up, this is the reason for the keyword logging, so as you can periodically check to see what needs adding to the replacements table.
4) Words/phrases and their suggested replacements can be added/edited/deleted at any time via the admin section.
5) Improved layout of Search results page if no results are found, providing the user with some tips on better searching.
6) Complete admin section to view and process logged search results.
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.
Note: Contributions are used at own risk.