Elasticsearch and a complex relationship

I'd totally forget about the existing model and would just think about the usage to build the right "search" objects for my use case.
Here I can't really answer as I don't know the use case and because it's not real objects.

Basically I'd recommend to ask yourself 2 questions:

  • What kind of objects my users want to get back as a response? If the answer is C then index a C object.
  • What typical attributes my users want to search for? B? Then store in the C object the content of the B object.

HTH

2 Likes