Partial SKU search?

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
pjs75
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jul 14, 2011 9:10 pm

Partial SKU search?

Post by pjs75 » Sun Nov 13, 2011 5:04 pm

Have noticed that search on partial SKU does not find anything. ie it needs to be full SKU. Can anyone suggest an easy/correct way to alter this? Was thinking of adding '*' to end of search inside the search control but that might be a bit dodgy..

Thanks,

Pat.

User avatar
david-ebt
Captain (CAPT)
Captain (CAPT)
Posts: 253
Joined: Fri Dec 31, 2010 10:12 am

Re: Partial SKU search?

Post by david-ebt » Sun Nov 13, 2011 11:00 pm

If you're using 7.0.3 or greater, then you can use the SQL full text search (turn it on in admin). The full text will only match on SKUs (or anything else) where the search BEGINS with your search term. You can add the * before and after and it will switch to a LIKE search. The problem with the like search is that it will require a full table scan for every search. That can be slow depending on the size of your product table.

What we recently did was add an option to let users search by keyword (full text) or by SKU. For the SkU search we do a LIKE with the wild card on both sides of the search term. Since it is only doing a table scan on the product SKU field it is fast enough.
David
http://www.ecombuildertoday.com
Enhanced Reporting for AbleCommerce
Image

Post Reply