title: aggregate on nested type properties - using NEST
body: <p>I'm trying to aggregate on counts of nested type, or sum of property of nested types, but unable to get NEST to include more than one nested document in the calculation.</p>
  
  <pre><code>        var result = elasticClient.Search&lt;ItemIncidents&gt;(s =&gt; s
               .Aggregations(a =&gt; a
               .Terms("group by role", ts =&gt; ts
                   .Field(o =&gt; o.LabelName)
                   .d
                   .Aggregations(aa =&gt; aa
                       .Sum("sum incidents", sa =&gt; sa                           
                            .Field("incidents.index")))
                   )
               )
          );
  </code></pre>
  
  <p>The classes used are this:</p>
  
  <pre><code>public class ItemIncidents
  {
      public int Id{get;set;}
      public string LabelName { get; set; }
  
    //  [ElasticProperty(Type = FieldType.Nested)]
      public List&lt;IncidentInstance&gt; Incidents { get; set; }
  }
  
   public partial class IncidentInstance:     {
      public string Id { get; set; }
      public int Index { get; set; }
      public int Count { get; set; }
    }
  </code></pre>
  
  <p>If I have more than one incidentinstance per ItemIncident, elastic is only counting the last one in the list in the aggregate count of index.  If the value of Index = 3 for all the IncidentInstances, and there are five documents each with two incidentinstances, the result I'm getting is 15 (5*1*3), instead of 30 (5*2*3).</p>
  
  <p>Is this an issue where I need to do some special attribute mapping on the Index field?</p>