// search/request/sort.asciidoc:515

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