close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search box is too generic

Thread began 6/20/2012 9:16 am by mrs | Last modified 6/21/2012 5:47 pm by Jason Byrnes | 1163 views | 8 replies |

mrs

Search box is too generic

Hi, I have been asked to change the search results from the search box in the menu bar.

The results that are being displayed are quite often un related to the product searched for. If a customer searches for oil filter, I am getting all results related to oil and all results related to filter. SO I am getting oil sumps and air filters among many others returned in the results. I am getting hundreds of results returned which is just unfriendly to the user.

I have tried enclosing the searches in quotes, but I am getting a lot of results still. Is there anyway of making the search results more specific without being completely specific to what has been entered?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

the search is a keyword search of the flowing columns:
ps4_products.ProductID
ProductSKU
ProductName
ProductCartDesc
ProductShortDesc
ProductLongDesc


a search of:
oil filter


will look for Oil OR Filter in those columns. using Double Quotes around the Search:
"Oil Filter"

Will cause it to look for the string Oil Filter in those columns.

you can edit the webassist/plugins/catalog/results.php or results_grid.php page to change the columns that are included in the search.


look for the following line:

php:
$KeyArr1 = array("ps4_products.ProductID", "ProductSKU", "ProductName", "ProductCartDesc", "ProductShortDesc", "ProductLongDesc");



and remove the columns you dont wish to search on.

Sign in to reply to this post

mrs

If a user enters the words:

Range Rover Sport Oil Filter

how do I get the search to return only those results that have all of those words in (regardless of which order it was typed)?

Without double quotes, what I am getting currently is results that have any one of the words typed leading to thousands of results like oil sumps, air filters, sports seats etc most of which may not be related to the Range Rover Sport. If I enclose the search words in quotes, then the results end up with nothing if they aren't typed in exactly to match a DB record... so if I searched "Oil Filter Range Rover Sport", I'd get nothing!

How can I over come this?

Just as an aside, I think this is where lucene becomes beneficial because it apparently gives results based on relevance, and the most relevant result is listed first, which is much more user friendly rather than returning loads of results in any order, or returning nothing because the exact match wasn't found. It would be good to see an extension from you clever guys built around lucene... if there isn't any licensing issues!

Sign in to reply to this post

Jason ByrnesWebAssist

use a comma to separate the search terms:

Range, Rover, Sport, Oil, Filter


Will cause the search to use AND, it will search the 6 columns i referenced in my previous reply for Range AND Rover AND Sport AND Oil AND Filter

Sign in to reply to this post

mrs

OK, is there a scripting method of placing commas before user inputted spaces when the search is clicked?

If so, I think I'm getting somewhere!

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

add this to line 1 of the products_results.php page to force commas into the search terms:

php:
<?php if(isset($_GET["S_ProductName"])) $_GET["S_ProductName"] = str_replace(" "", "$_GET["S_ProductName"]); ?>
Sign in to reply to this post

mrs

Excellent... that worked a treat!

Thank you Jason

Sign in to reply to this post

mrs

I have to say Jason, that last line you've told me to add to enable me to insert commas before spaces has made a huge difference. As a result, it is both quite generic or really very specific... all from the same search box. In fact, it's enabled me to get rid of the more detailed search entirely.

Thanks again.

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...