title: ElasticSearch geo distance filter with multiple locations in array - possible?
body: <p>Let's say we have a bunch of documents in an ElasticSearch index. Each documents has multiple locations <em>in an array</em>, like this:</p>
  
  <pre><code>{
    "name": "foobar",
    "locations": [
      {
        "lat": 40.708519,
        "lon": -74.003212
      },
      {
        "lat": 39.752609,
        "lon": -104.998100
      },
      {
        "lat": 51.506321,
        "lon": -0.127140
      }
    ]
  }
  </code></pre>
  
  <p>According to the <a href="http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter/" rel="noreferrer">ElasticSearch reference guide</a></p>
  
  <blockquote>
    <p>the <code>geo_distance</code> filter can work with multiple locations / points
    per document. Once a single location / point matches the filter, the
    document will be included in the filter.</p>
  </blockquote>
  
  <p>So, is it possible to create a geo distance filter which checks all the locations in the array? </p>
  
  <p>This doesn't seem to work, unfortunately:</p>
  
  <pre><code>{
    "filter": {
      "geo_distance": {
        "distance": "100 km",
        "locations": "40, -105"
      }
    }
  }
  </code></pre>
  
  <p>throws "<code>QueryParsingException[[myIndex] failed to find geo_point field [locations]</code>" since <code>locations</code> is not a single <code>geo_point</code> but an array of <code>geo_point</code>s.</p>