title: Elasticsearch DSL python queries with filters and aggregations on nested properties
body: <p>I would like to build a filtered Elasticsearch query using filtering via nested objects plus make an aggregation to get the minimum value of a nested object inside a nested objects list.</p>
  
  <p>The filtering part works but I can't bind it with the aggs (aggregations) part.
  When I add the <code>.aggs.bucket</code> part to my code after the filters it's either being ignored (not visible in the <code>search.to_dict()</code>) or gives me syntax errors.</p>
  
  <p>Can anybody give me an example on how to bind those together? I'm trying to get both the filtered query result end the calculated minimum value from <code>nested1.foo.bar</code> in one response</p>
  
  <p>Example schema:</p>
  
  <pre><code>class MyExample(DocType):
      myexample_id = Integer()
      nested1 = Nested(
          properties={
              'timestamp': Date(),
              'foo': Nested(
                  properties={
                      'bar': Float(),
                  }
              )
          }
      )
      nested2 = Nested(
          multi=False,
          properties={
              'x': String(),
              'y': String(),
          }
      )
  </code></pre>
  
  <p>Building the query:</p>
  
  <pre><code>from elasticsearch_dsl import Search, Q
  
  search = Search().filter(
      'nested', path='nested1', inner_hits={},
      query=Q(
          'range', **{
              'nested1.timestamp': {
                  'gte': exampleDate1,
                  'lte': exampleDate2
              }
          }
      )
  ).filter(
      'nested', path='nested2', inner_hits={'name': 'x'},
      query=Q(
          'term', **{
              'nested2.x': x
          }
      )
  ).filter(
      'nested', path='nested2', inner_hits={'name': 'y'},
      query=Q(
          'term', **{
              'nested2.y': y
          }
      )
  )
  </code></pre>
  
  <p>Basically what I need to do is to get the min value for all the nested nested1.foo.bar values for each unique MyExample document (they have unique myexample_id field) </p>