Best approach to combining relationships to generate an index

If I want to generate an index based on two or more separate relationships, what is the best approach?

For example, I want a page that lists all products produced by Acme Co. that are in the category Hardware. So I have a Product content type, and a Company content type, and a Category keyword or content type (not sure which is the better option). And I have a slot relating the Product to the Company and maybe a slot or just a field for the Hardware Category.

Should I just do a foreach loop inside a foreach loop in Velocity to find products that match both Category and Company? Or is there a better way?

Hi April

I’d be inclined to include a company multiselect control on the product so you can create auto indexes/auto slots using the below query:

SELECT rx:sys_contentid, rx:sys_folderid FROM rx:Product WHERE rx:category = 'Hardware' AND rx:company = 'Acme' 

Cheers
James

[QUOTE=jimbo;5957]Hi April

I’d be inclined to include a company multiselect control on the product so you can create auto indexes/auto slots using the below query:

SELECT rx:sys_contentid, rx:sys_folderid FROM rx:Product WHERE rx:category = 'Hardware' AND rx:company = 'Acme' 

Cheers
James[/QUOTE]

Oh! I didn’t know I could reference a field that way. That’s pretty simple.

Thanks.