Filter type A by field from type B

I have an existing index containing millions of products. Each product has a manufacturer field. When you search by manufacturer multiple products will be returned.

To get the list of products appropriate to a client, my app would pass a client specific term filter listing all relevant manufacturers. But this list keeps growing - some cases now exceed 2000 terms. Seems like this is no longer a viable solution.

While investigating alternatives, I played around with parent-child relationships. I can achieve my goal using these, but the documentation warns about query performance and also suggests few parents and many children is the most appropriate model. Unfortunately as I am trying to work with the pre-existing product index, I have the opposite.

In essence what I'm trying to achieve is to get all products (i.e. match_all) where the product.manufacturer = client. preferred_manufacturer (of which there may be many). Can you suggest the best approach to solving this problem? in SQL terms I am basically looking to do an INNER JOIN.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.