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