In my data model, I have users and events performed by those users.
A user is represented by a parent document. The events are child documents.
I would like to do a query where I say, "Find parents who have done event X (ie who have a child of X), and show me (for example) the most common event each parent has done. (ie for each parent look at its children and perform one aggregation per parent)"
Unless I am mistaken, the has_child filter only gives me the list of parents whose children match a certain set of criteria. I can't THEN say - given this list of parents, for each parent, give me (for example) the number of children each parent has that meet some other criterion? I think I would have to do a separate query for each parent? Or is there a way to do an aggregation on a list of parents' children?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.