// This file is autogenerated, DO NOT EDIT
// search/search-your-data/sort-search-results.asciidoc:420

[source, python]
----
resp = client.search(
    sort=[
        {
            "_geo_distance": {
                "pin.location": [
                    -70,
                    40
                ],
                "order": "asc",
                "unit": "km",
                "mode": "min",
                "distance_type": "arc",
                "ignore_unmapped": True
            }
        }
    ],
    query={
        "term": {
            "user": "kimchy"
        }
    },
)
print(resp)
----
