I have a collection/channel of products, where each product belongs to multiple categories. I have two category groups: product and collection. Example product categories include 'shirts' and 'hats'. Example collection categories include 'blue' and 'on sale'. collection categories can be thought of as children of product categories, though in the EE backend, their category groups are siblings.

I have a form that lets you input a keyword to search by, and then a tree of the product and collection categories.

I have a pseudo-query of what I need to accomplish:

  keyword = 'foo'
  ( product_cat = 'shirt' AND ( collection_cat = 'blue' OR collection_cat = 'on sale' ) )
  ( product_cat = 'hat' AND ( collection_cat = 'blue' ) )

I know you can search through multiple categories by sending an array of category IDs, but in this case I need to have a parent-child category relationship.

Is this possible?

1 Answer 1


That specific example isn't possible, but you can get pretty close, despite not being able to account for the quasi-relationship between category groups you've defined.

With Low Search, you can do the equivalent of this:

SELECT * FROM entries
WHERE keyword = 'foo'
AND (product_cat = 'shirt' OR product_cat = 'hat')
AND (collection_cat = 'blue' OR collection_cat = 'on sale')

..which is the same as:

SELECT * FROM entries
WHERE keyword = 'foo'
AND product_cat IN ('shirt', 'hat')
AND collection_cat IN ('blue', 'on sale')

...thus also searching for hats on sale.

  • Thanks for your reply, I was afraid it wouldn't be possible. I'm currently using category group filtering, but it'd be great if we had tighter control over the filtering. Something like setting the input name to category:foo:and[] or category:bar:or[] would be great :)
    – Arms
    Commented Feb 26, 2013 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.