// search/request/sort.asciidoc:470

[source, php]
----
$params = [
    'body' => [
        'sort' => [
            [
                '_geo_distance' => [
                    'pin.location' => '40,-70',
                    'order' => 'asc',
                    'unit' => 'km',
                ],
            ],
        ],
        'query' => [
            'term' => [
                'user' => 'kimchy',
            ],
        ],
    ],
];
$response = $client->search($params);
----
