Hi david,
I put more thought into the hierarchy and I thought maybe it would be better just do build the query based on the merchant. So if your on the merchant page you can select a category, then second and third, just for that merchant. Let me know if that's possible.