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