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
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.