<p dir="auto">I think this could be a very practical solutions for whole set of issues where aggregation needs to be done on nested documents but be able to group on its parent document properties. It i snot the same as using reverse nested because reverse nested changes document scope to groupp and then it will needs to be changed back to nested again introducing double-counting.<br>
Also from ease of use it would be a significant step forward comparing to using reverse nested just to be able to access parent document properties (even if were equivalent)</p>
<p dir="auto">Here is an example I used in another issue:</p>
<p dir="auto">Imagine having Teams that handle Requests of certain Priority. Each request may have multiple teams assigned to it and each team request assignment has number of hours allocated for this team on this request</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="request:{
  priority:1,
  teams:[
    {name:'team1', hours:10},
    {name:'team2', hours:20},
  ]
}"><pre class="notranslate">request:<span class="pl-kos">{</span>
  <span class="pl-c1">priority</span>:<span class="pl-c1">1</span><span class="pl-kos">,</span>
  <span class="pl-c1">teams</span>:<span class="pl-kos">[</span>
    <span class="pl-kos">{</span><span class="pl-c1">name</span>:<span class="pl-s">'team1'</span><span class="pl-kos">,</span> <span class="pl-c1">hours</span>:<span class="pl-c1">10</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">{</span><span class="pl-c1">name</span>:<span class="pl-s">'team2'</span><span class="pl-kos">,</span> <span class="pl-c1">hours</span>:<span class="pl-c1">20</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I need a report that gives me number of hours by team by priority. Doing nested aggregation on <strong>teams.name</strong> and then reverse nested to group on <strong>priority</strong> and then nested to sum <strong>teams.hours</strong> double-counts hours because second nesting on teams knows nothing about  upstream nesting as it is executed in context of request and as result it will lump hours for each team on request under the top level team aggregation</p>
<p dir="auto">If i could access "../priority" from teams nested document context I would not have to use reverse nested and lose my aggregation context and everything would have worked like a charm</p>
<p dir="auto">please see also <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="130759616" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/16380" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/16380/hovercard" href="https://github.com/elastic/elasticsearch/issues/16380">#16380</a></p>
<p dir="auto">If multiple hosts are running on a single server hostname doesn't provide an accurate picture of the recovery process.  Addition of node name, or at least the ports would differentiate between the different  running processes.</p>