title: Elasticsearch nested geo-shape query
body: <p>Suppose I have the following mapping:</p>
  
  <pre><code>  "mappings": {
      "doc": {
        "properties": {
          "name": {
            "type": "text"
          },
          "location": {
            "type": "nested",
            "properties": {
              "point": {
                "type": "geo_shape"
              }
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>There is one document in the index:</p>
  
  <pre><code>POST /example/doc?refresh
  {
      "name": "Wind &amp; Wetter, Berlin, Germany",
      "location": {            
          "type": "point",
          "coordinates": [13.400544, 52.530286]
      }
  }
  </code></pre>
  
  <p>How can I make a nested geo-shape query?
  Example of usual geo-shape query from the documentation (the "bool" block can be skipped):</p>
  
  <pre><code> {
          "query":{
              "bool": {
                  "must": {
                      "match_all": {}
                  },
                  "filter": {
                      "geo_shape": {
                          "location": {
                              "shape": {
                                  "type": "envelope",
                                  "coordinates" : [[13.0, 53.0], [14.0, 52.0]]
                              },
                              "relation": "within"
                          }
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>Example of a nested query is:</p>
  
  <pre><code>{
      "query": {
          "nested" : {
              "path" : "obj1",
              "score_mode" : "avg",
              "query" : {
                  "bool" : {
                      "must" : [
                      { "match" : {"obj1.name" : "blue"} },
                      { "range" : {"obj1.count" : {"gt" : 5}} }
                      ]
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Now how to combine them? In the documentation it is mentioned that nested filter has been replaced by nested query. And that it behaves as a query in “query context” and as a filter in “filter context”. </p>
  
  <p>If I try query for intersect with the point:</p>
  
  <pre><code>    {
    "query": {
      "nested": {
        "path": "location",
        "query": {
          "geo_shape": {
            "location.point": {
              "shape": {
                "type": "point",
                "coordinates": [
                  13.400544,
                  52.530286
                ]
              },
              "relation": "disjoint"
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>I still get back the document even if relation is "disjoint", so it's not correct. I tried different combinations, with "bool" and "filter", etc. but query is ignored, returning the whole index. Maybe it's impossible with this type of mapping? </p>
  
  <p>Clearly I am missing something here. Can somebody help me out with that, please? Any help is greatly appreciated.</p>