'Serialize the search to a structure as passed for a search body.'

def serialize(self):

    if (not self.field):
        raise InvalidSortOrder('sort    order    must    contain    field    name')
    return {self.field: self.serialize_order_params()}
