def serialize(self):
        res = []
        for _sort in self.sort_orders:
            res.append(_sort.serialize())
        return res or None
Serialize the search to a structure as passed for a search body.
dataset/ETHPy150Open aparo/pyes/pyes/sort.py/SortFactory.serialize