The above query is just a simplified version of what I'm actually doing. Sometimes I'm really trying to get a count based on fields in the parent document, and fields in the nested documents. But I only want the count that returns to be the number of parent documents.
you mixed a bit of different concepts in elasticsearch terminology here. nested is something different than parent/child than inner objects. Can you maybe explain your data model, and also provide the real query, plus sample documents, so that other can reproduce this?
You're right, I'm not entirely sure the difference between those two concepts. I've simplified the data model for your purposes, and I've provided the mapping below:
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.