code: def to_dict(self, **kwargs):
          
          d = {}
          if self.query:
              d["query"] = self.query.to_dict()
  
          if self._script:
              d['script'] = self._script
  
          d.update(self._extra)
  
          d.update(kwargs)
          return d
docs: Serialize the search into the dictionary that will be sent over as the
          request'ubq body.
  
          All additional keyword arguments will be included into the dictionary.