keat Posted March 13, 2016 Share Posted March 13, 2016 I've been told that customers can't search by partial part number. I've tried to explain that messing with this will break the search, which is one complaint we had on our V3 example, if we sell items with part number GRN1, GRN2, GRN3, GRN4, etc, and you search GRN, then nothing comes up. Is there a way to improve this ? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 13, 2016 Share Posted March 13, 2016 There is a Suggestive Search mod/plugin that might solve our problem. Our way around such things is to change search so it searches the meta_keywords instead of the title or description, and I did various queries to add common variations to my existing keywords - for instance I discovered by watching Customers Online that some people search for bears, rather than bear. So I added the plurals to all animals to the keywords. I've added common misspellings, too. So you could add GRN to each of your part number variations that way. Quote Link to comment Share on other sites More sharing options...
keat Posted March 13, 2016 Author Share Posted March 13, 2016 I don't really want to start editing products, I've 4500 of them. If I search GRN1, it will show GRN1, but if I search GRN, it shows nothing. I guess its running a search query along the lines 'if product_code equals xxx', so maybe changing the query to 'if product_code is like% xxx' would do the trick. Of course this has the ability to dilute the search. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2016 Share Posted March 13, 2016 This has been a thorn in the side of almost everyone. There is a conversation on these forums where an edit seems to get more results - but somewhat diluted as you surmise. https://forums.cubecart.com/topic/49330-fuzzy-search/?do=findComment&comment=211807 Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 13, 2016 Share Posted March 13, 2016 I have over 4,000 as well. But it was not really hard to add to the keywords. Of course you may not have keywords filled in at all - not everyone does. Using UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring"); Something like CubeCart_inventory set seo_meta_description = replace(seo_meta_description,"GRN1,","GRN1,GRN,"); Quote Link to comment Share on other sites More sharing options...
keat Posted March 13, 2016 Author Share Posted March 13, 2016 I'll have a look at the thread, but I guess it might be easier to say 'it's V6, live with it' Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2016 Share Posted March 13, 2016 "Do not go gentle into that good night." Quote Link to comment Share on other sites More sharing options...
keat Posted March 13, 2016 Author Share Posted March 13, 2016 I made the code change, and as suspected, it did indeed ruin the search. For instance search the phrase 'NUT', and not only does it reveal nuts, but anything else that contains the phrase nut, like superglue which sets in 1 minute, or a soldering which heats in under 2 minutes. Search for our part number TR (which is a range of cable ties) and a wire stripper shows up. I've left it in situ just to prove my point. Thanks chaps. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2016 Share Posted March 13, 2016 I get the impression that the search parameters for your inventory should be restricted to just the product name and product code, and not include the product description. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2016 Author Share Posted March 14, 2016 It's a catch 22, On the old V3, we had such a fuzzy search that customers would complain that search results were not relevent, as can be seen above, and found it difficult to find anything. The argument this weekend was: 'A customer who knows grease nipples are GRN part numbers would search GRN but the results come back null' My reply was, 'But if he's half an ounce of intelligence, he'd search 'grease' 'nipple' or 'grease nipple and new customers wouldn't know GRN anyway' Now after the code change, we can search GRN, but the results come back so diluted. (maybe not with GRN, but with lots of others it does) it's ruined the search facility. I have left the code change in situ so the powers that be can see for themsleves. Personally, i feel there was nothing wrong, but i don't make those descisions. In the meantime, I assume this line has something to do with the search. $rlike = " AND (I.name RLIKE '".$regexp."' OR I.description RLIKE '".$regexp."' OR I.product_code RLIKE '".$regexp."')"; Would it be possible to change i.product_code to something along the lines like%% Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 14, 2016 Share Posted March 14, 2016 I.name, I.description, and I.product_code are the names of the columns to look in, not the pattern of values to look for. The pattern is contained in the variable $regexp and has the search term surrounded by %. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2016 Author Share Posted March 14, 2016 I don't profess to understand PHP, reading it, is like reading another language. I can sort of half make out what it's trying to say, then try to fill in the blanks. Hence the reason I assumed $rlike = " AND (I.name RLIKE '".$regexp."' OR I.description RLIKE '".$regexp."' OR I.product_code RLIKE '".$regexp."')"; was doing some sort of lookup. If the name is like something, descriptioin is like something, and product code is like something. Therefore concluded I could use like%, but only on the product_code part. I guess not. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2016 Share Posted March 14, 2016 So, until some better code comes along, I'd like to pursue a discussion of my meta_keywords solution. Our store was dead until we had a way to search that made sense for our products. Bsmither coded a completely different way of searching for us, but I don't think that code would help your situation. Then adding to his custom search code the changing to search keywords, not title and definition, AND having the ability to easily modify the keywords for large number of items at once via queries - has made all the difference to us. Do you currently have terms in seo_meta_keywords for each product? For instance, would all these GRN items have grease or grease nipple as a keyword? Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2016 Author Share Posted March 14, 2016 We have nothing in seo_meta_keywords. I really don't want to start editing 4500 products, if i'm being honest The boss has conceded that it was broken, and i've rolled it back to how it was. If I can use a wildcard on product_code somewhere and it allows us to search on products codes then great, but if not then I'm happy to leave it the way it is for now. If we start getting customer complaints, then I'll re-address it. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2016 Share Posted March 14, 2016 I understand. It's easy to do IF you have a good set of keywords already in place for each product. With keywords currently blank, my way would certainly not work. Since you are not the only one with part number search issues, hopefully someone will solve this problem without diluting search results past usefulness. Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2016 Author Share Posted March 14, 2016 What I don't understand is I can input a specific part number like GRN1, and GRN1 turns up, along with a kit which contains a GRN1 (as it's in the description) So I'm guessing the search somewhere must be doing 'where product_code=', so wouldn't 'where product_code Like%' fix this. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 14, 2016 Share Posted March 14, 2016 As I understand it, Search is based on terms in the title and the description. Would yours work better if it were ONLY the title? Quote Link to comment Share on other sites More sharing options...
keat Posted March 14, 2016 Author Share Posted March 14, 2016 Probably not to be honest. The boss was suggesting that a customer should be able to search partial part numbers, as well as everything else. But the fact that the edit broke it, proves that it's one or the other but not both. Quote Link to comment Share on other sites More sharing options...
yorksred Posted January 29, 2017 Share Posted January 29, 2017 Sorry to bump old thread but may help other people I was having problems with search where I could search the first 3 words of the title of one of my products and it would appear on the 3rd page of results, while products with non of those words would be at the top of the results. Very strange the cubecart search function lol. Changing the relevance didn't help. Any way using this thread and the one linked I managed to sort it by deleting OR I.description RLIKE '".$regexp."' and changing $search_mode = 'fulltext' to $search_mode = 'like' in the /classes/catalogue.class.php file This worked for me as I feel it was more important to search the title than the description. Quote Link to comment Share on other sites More sharing options...
keat Posted February 2, 2017 Author Share Posted February 2, 2017 This is still ongoing for me, the search function almost ruins the experience if I'm being honest. Maybe the search function should have a drop down, where the customer could choose whether he wants to search by Product Code, Title, Description or take his chances, which is what happens at the moment.. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 2, 2017 Share Posted February 2, 2017 I may have a solution to do that. I wrote some snippets that allowed a store to be searched on the UPC code. This should be easily adapted to search on whatever specifics is desired. Send me a PM with your email address and we can experiment. 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.