You can flatten the structure into a single level document, or you can use nested documents with "include_in_parent" mapping, which virtually does the same thing. The latter workaround described in this issue: https://github.com/elastic/kibana/issues/1084
Any plans on inluding P/C aggregation in Kibana any time soon?
In our case (translated to the branch/employee example) we cannot "nest" all employees within the branch document, because we add many new employees (belonging to one branch) to the index and it seems to me that would be too many updates on the branch document, if we can't handle them as different documents.
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.