Saturday, November 22nd 2008 | dance | trends | lot10 on Squidoo | my zimbio
Google

What-is-ASM.com ::

2 or more Word Searches


Knowledgebase
Installation
Browse Nodes
Customization
Integration
WebDev
Interconnect
New On Squidoo
Browse Node Lookup
The Way Of The Web
Deals & Steals
OneAutoBox
OneHomeChoice
OneHotFuzz
OneHotPick
OnePhotoBox
OneShoeBox
OneToolBox
OneWatchBox
PickABag



Doing a straight 2 or more word searches like Harry Potter on the default script will yeild a list of products with no images and a blend of results both from Harry and Potter.

A better and more refined result is possible if you force the script to treat Harry+Potter as a single word. This is done by adding the plus (+) or underscore (_) signs between the words you are searching for.

The default script will also not pass the search terms as a variable that can be displayed on the results page.


Passing the $Keywords variable as a $browsename
This can be easily done by editing the script/browsepage.php file to include a patch that will pass the search keywords as a browsename variable.

Edit the script/browsepage.php, and add the following :

to the $search function, as discussed in the forum here and here :



Complementing the search function
The patch to complement the search function, enabling it to accept 2 or more words as a specific search term was discussed in the forum here. We tried all three suggestions and found that the patch by dgenr8 works best with our modified site. The patch is reprinted below.

Edit the script/common.php, look for the following function :

and add the following function subsequent to that :


Next edit the script/aws4class.php file and replace the following section :

with these :

What this patch does is to basicaly converts search terms with a ' ' (space) into a 'search-like-this' term (with dashes), with corresponding results. The URL will show plus (+) signs between the words.

As an example, this is how a search for Harry Potter Books results from this site (opens a new window).

That should do it, thanks.


© 2006, dinodino :
All articles/tutorials are copyright and may not be reproduced without prior consent of their owners.


Copyright © 2005 - 2008   All Rights Reserved   WebDev by : What-is-ASM.com