Search for something that must not contain xxx or xxx or xxx

So I'll start off by explaining what I need to do. Users on my site will have an inventory of items, all possible items are stored in a database. The user can then search for "recipes", I want to be able to search for "recipes" that don't contain anything the user doesn't have. Here's the problem there could potentially be thousands of items and recipes, and it probably wouldn't be a good idea to have 1000+ must_not's in a single query. How would I go about doing this in a way that wouldn't require one of Google's data centers ?

See Matching by array elements . There isn't a great solution but there are solutions.

The problem is must_not["xxx"...(x10,000 items)] x 10,000 recipes = 100,000,000 comparisons x number of searches(multiple users, auto-complete). What kind of hardware would this require? I could make the item array integer ids of the items, but wouldn't it still be very demanding? Hmm, I could sort the least used items first to be compared, assuming that it stops on the first case that returns false, it could help performance.