Elastic Search 6 Nested Query Aggregations
Your First Questions answer is in this link nested inner doc count Which Stats
POST test/_search{ "query": { "nested": { "path": "employee", "inner_hits": {} } }}
This Answers your Second Question there is also reading the link attached.
GET /my_index/blogpost/_search{ "size" : 0, "aggs": { "employee": { "nested": { "path": "employee" }, "aggs": { "by_name": { "terms": { "field": "employee.empName" } } } } }}
I hope this gives you what you need.