title: Mock elasticsearch nested buckets
body: <p>I'm trying to mock elasticsearch nested aggregation object with the following structure. I did something as described at the attached link, but couldn't do it for nested object:
  <a href="https://stackoverflow.com/questions/52969724/mock-elastic-search-response-in-net">Mock Elastic Search response in.Net</a></p>
  <p>Here is the real elastic object I've been tying to mock.</p>
  <pre><code>var obj= new AggregationDictionary
              {
                 {
                      &quot;key1&quot;,new TermsAggregation(&quot;key1&quot;)
                      {
                          Field=&quot;1234&quot;,                         
                          Aggregations = new AggregationDictionary
                          {
                             &quot;top&quot;,new TopHitsAggregation(&quot;top&quot;)
                                  {
                                      Size =10
                                  }
                              }
                          }
                     }
                  }
              };
  </code></pre>