First production schema issues - ES beginner


I am trying to create an elasticsearch index in order to achieve my goals.
The main problem of the task is it's complexity, and after 3 days of tries,
retries etc, i am turning to this group for suggestions:

I want to create a statistics page that would allow me to do following

As a forum owner, i would like to search and filter (only) my users, based
on their activity or their status regarding the forum application, and of
course i should be able to see some data aggregation (activity within 30
days, 7 days ) etc.

My database structure looks like :

I have tried to create the index the user model, but for some reason, it
get's fuzzy when it comes to filter the results, as i would always need to
filter based on a forum id, and if needed to orfder by the nested status in
the user_forums association.

I have thought to create it on user_forum model, but i would end up, with
having multiple duplicates for user record.

Any ideea on how could i structure that, given the fact that all the infos
might become a facet?

Thanks in advance

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit