roban Posted March 15, 2006 Share Posted March 15, 2006 I'm wanting to have CC search for titles only on a site I'm working on. There is a 'fix' posted about changing 'OR' for "AND' in viewCats but that doesn't work for me. Any other thoughts? Quote Link to comment Share on other sites More sharing options...
Guest [email protected] Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
roban Posted March 15, 2006 Author Share Posted March 15, 2006 Thanks for the reply. I had done that as well with another site using isearch. I am after a fix for the CC search which I think would benefit all. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2006 Share Posted March 15, 2006 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? Quote Link to comment Share on other sites More sharing options...
roban Posted March 15, 2006 Author Share Posted March 15, 2006 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 Quote Link to comment Share on other sites More sharing options...
roban Posted March 15, 2006 Author Share Posted March 15, 2006 That edit produces a sql error but your edited string works very well. very nice. Thanks. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 15, 2006 Share Posted March 15, 2006 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. Quote Link to comment Share on other sites More sharing options...
Guest Neveryll Posted March 16, 2006 Share Posted March 16, 2006 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. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 16, 2006 Share Posted March 16, 2006 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. Quote Link to comment Share on other sites More sharing options...
Guest mediajunk Posted November 28, 2006 Share Posted November 28, 2006 Thanks ZAP, works brilliantly!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.