do you want something like the treeList finder
but with ingredients as children?
you might loop over the results of the treeList
query and set the children (here you can make once query per category, or get all sorted by category_id and do the matching in a foreach loop)
that way you might do something like optiongroup
for each category, with the ingredients as options
Also I suggest using a counter cache behavior to filter categories without children.