

def serialize_order_params(self):
    res = super(GeoSortOrder, self).serialize_order_params()
    if self.geohash:
        res[self.field] = self.geohash
    elif ((self.lat is not None) and (self.lon is not None)):
        res[self.field] = [self.lat, self.lon]
    else:
        raise InvalidSortOrder('Either geohash or lat and lon must be set')
    if self.unit:
        res['unit'] = self.unit
    return res

dataset/ETHPy150Open aparo/pyes/pyes/sort.py GeoSortOrder.serialize_order_params/original