Index design for large lists of document references

Hi, I'm kind of new to elasticsearch and I wonder if i overlook a better solution to my Problem:
I have an index of quite large documents (< 1mb) with > 100,000 entries, lets call them "products" and a lot of "customers" who all posses a subset of "products" (>80,000).

I used to have a separate index for the "customer", referencing the "products" they posses by their respective "id" by storing them in an array.

So a "customer" decument would kinda look like this:
"_index" : "customer", "_type" : "_doc", "_id" : "1", "_source" : { "product_ids" : [1,2,...] }

Then i would use the terms lookup api to get all the products belonging to a certain customer. I wonder if there is a better approach to this, because these queries are getting quite slow with growing indexes.

An obvious approach would be the storing of all the products for every customer, but the product documents are just too large for that.

Thank you in advance!

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