[source, ruby]
----
response = client.search(
  body: {
    sort: [
      {
        _geo_distance: {
          'pin.location' => [
            [
              -70,
              40
            ],
            [
              -71,
              42
            ]
          ],
          order: 'asc',
          unit: 'km'
        }
      }
    ],
    query: {
      term: {
        user: 'kimchy'
      }
    }
  }
)
puts response
----
