// search/request/sort.asciidoc:539

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