[ic] Categories - one product in multiple categories

Chris Rapier rapier@psc.edu
Fri, 02 Mar 2001 17:48:58 -0500


cfm@maine.com wrote:
> 
> On Fri, Mar 02, 2001 at 12:30:43PM -0800, nwcorp@helpwizard.com wrote:
> > Does anyone know the magic trick for allowing one product to appear in
> > multiple categories?    Can't seem to find any info in the .pdf files or
> > here among the users.
> 
> keep the list of categories in which any particular product belongs
> in a separate table and JOIN

Alrternatively, a somewhat simpler way of doing this is to set up
multiple category columns

eg

sku	desc	cat_1	cat_2	cat_3	
1		this	none	blue	
2		that	all	red 		
3		other	all	blue

Then you just search against all three categories for the key word. In
this case a search on blue would return products 1 and 3, a search on
all would return 2 and 3. A search on this and blue would return only 1.
Assuming that you disabled or searching.

The problem is that this only works well with smaller catalogs and a low
number of categories columns. If you have 16 category columns and 27,000
items this is simply not the right way to do it. Mr. Miller's example
seems more versatile to me.