Hi Guys

I am trying to create a retail search solution that lets users specify their requirements dynamically.
Ie a user might be searching for a tv, one requirement is that type=smart, and then either its "size>32 and price<3000" or "size>=48 and price=5000"

So I'm having a real problem structuring this in a dynamic way. Thus far i have the following tables:

Search_Item

HTML Code:
ID	Generic_Product
1	TV
2	HiFi
Search_Filters

HTML Code:
ID	Item_ID	Description	operator	Value	Criteria_Group
1	1	Price		<		3000	1
2	1	Size		>		32	1
3	1	Size		>=		48	2
4	1	Price		=		5000	2
5	1	Cores		>=		2	3
6	1	Intensity	> 		10000	4
7	1	Brand		=		Samsung	5
8	1	Brand		=		Hisense	5
Operation_Grouping

HTML Code:
ID	Group_Operation
1	AND
2	AND
3	
4	
5	OR
I'm able to specify what operation happens within each grouping, and am currently limited to joining the relevant groups with an "and" clause, But I really want an eloquent way to specify the operations between the groups, especially if I want to nest them.

Hopefully you can understand what I'm trying to do from the examples. Any help / scolding would be appreciated

Regards