Jump to content

Search


roban

Recommended Posts

Although slightly unrelated, I'm not sure if this idea would be any help. On a previous store I did, I completey removed the search function and put a new one in using Google's API function instead. Thus meaning all pages were searchable not just the products. Although this wouldn't be recommend if your doing lots of searching per-day as google limits it to 1000 queries. I could find the code if you wanted it.

Link to comment
Share on other sites

I agree. I'll probably do this today or tomorrow. Although I also want to search for anything on any page (and show the results differently).

Seems to me as if you could just modify the SQL query in includes/viewCat.inc.php.

meaning that

$like .= "(name LIKE '%".$searchArray[$i]."%' OR description LIKE '%".$searchArray[$i]."%' OR productCode LIKE '%".$searchArray[$i]."%') OR ";




would be hacked down to:




$like .= "name LIKE '%".$searchArray[$i]."%' OR ";

Does that do the trick for you?

Link to comment
Share on other sites

I agree. I'll probably do this today or tomorrow. Although I also want to search for anything on any page (and show the results differently).

Seems to me as if you could just modify the SQL query in includes/viewCat.inc.php.

meaning that

$like .= "(name LIKE '%".$searchArray[$i]."%' OR description LIKE '%".$searchArray[$i]."%' OR productCode LIKE '%".$searchArray[$i]."%') OR ";




would be hacked down to:




$like .= "(name LIKE '%".$searchArray[$i]."%' OR ";

Does that do the trick for you?

I'll try it and let you know

Link to comment
Share on other sites

That edit produces a sql error but your edited string works very well. very nice. Thanks.

Cool beans. Glad to help. I didn't notice that extra ( in there until after I posted, and I guess you were already trying it before my edit went through.

Link to comment
Share on other sites

Guest Neveryll

That edit produces a sql error but your edited string works very well. very nice. Thanks.

Cool beans. Glad to help. I didn't notice that extra ( in there until after I posted, and I guess you were already trying it before my edit went through.

Nice code tweak. I added it to my website as well as we were getting too many odd hits. Next question is there a way to force the search option to recognize quotation marks so that you can do searches on phrases? I currently try to use quotes and it seems to ignore them and just search the individual words.

Link to comment
Share on other sites

Nice code tweak. I added it to my website as well as we were getting too many odd hits. Next question is there a way to force the search option to recognize quotation marks so that you can do searches on phrases? I currently try to use quotes and it seems to ignore them and just search the individual words.

Link to comment
Share on other sites

  • 8 months later...

Join the conversation

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

Guest
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...