title: How to build sibling aggregations using the Elasticsearch Java API?
body: <p>I want to do a filter aggregation, nested aggregation, and then 3 sibling aggregations. I have tested this and it works using the REST API. Here is the query I used:</p>
  
  <pre><code>{
    "aggs": {
      "filter_agg": {
        "filter": {
          ...
        },
        "aggs": {
          "nested_agg": {
            "nested": {
              "path": "myProperty"
            },
            "aggs": {
              "sibling_agg_1": {
                ...
              },
              "sibling_agg_2": {
                ...
              },
              "sibling_agg_3": {
                ...
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Now, I want to implement this query using the Java APIs in my codebase. I am not sure how to do sibling aggregations, as the only method available to the <code>FilterAggregationBuilder</code> is <code>subAggregation()</code>.</p>
  
  <p>In the context of the Java API is are these sibling aggregations sub aggregations?</p>
  
  <p>The Java code I have started to write looks like this:</p>
  
  <pre><code>client.prepareSearch(index)
      .setTypes(types)
      .setSearchType(SearchType.COUNT)
      .addAggregation(myFilterAggregation
        .subAggregation(AggregationBuilders.nested("nested_agg").path("myProperty"))
  </code></pre>
  
  <p>and then the only thing I can continue to do to build the <code>SearchRequestBuilder</code> is more <code>subAggregation</code>'s - is that the correct way to implement this? The REST API and Java API seem different in this case.</p>