I am using ES 5. With Nest lib on C#.
I have two indexes on ES. One have contact information and the other contact events. Each customer in my system can have lot of contacts and each contact can trigger a bigger number of events. Almost each contact action is an event.
I have all contanct information in a "Contact" index, and all my events information in an "Event" index.
So I have a search that can filter by contact information and by events. The problem that I have is how to join the two searchs, the one for contacts and the one for events, in one search.
Right now I have two queries, first I get the contacts that match, and then I search the events for those contact ids. The problem is that the first search can return thousents of contacts ids and I need to feed the second search with all those.
Is there a better way to do this? or should I re-think my indexes to for example store contact and events together and use a parent/child strategy?