def to_dict(self, count=False, **kwargs):
    "\n        Serialize the search into the dictionary that will be sent over as the\n        request's body.\n\n        :arg count: a flag to specify if we are interested in a body for count -\n            no aggregations, no pagination bounds etc.\n\n        All additional keyword arguments will be included into the dictionary.\n        "
    d = {}
    if self.query:
        d['query'] = self.query.to_dict()
    if (not count):
        if self.post_filter:
            d['post_filter'] = self.post_filter.to_dict()
        if self.aggs.aggs:
            d.update(self.aggs.to_dict())
        if self._sort:
            d['sort'] = self._sort
        d.update(self._extra)
        if (self._source not in (None, {})):
            d['_source'] = self._source
        if self._highlight:
            d['highlight'] = {'fields': self._highlight}
            d['highlight'].update(self._highlight_opts)
        if self._suggest:
            d['suggest'] = self._suggest
        if self._script_fields:
            d['script_fields'] = self._script_fields
    d.update(kwargs)
    return d
Serialize the search into the dictionary that will be sent over as the
request's body.

:arg count: a flag to specify if we are interested in a body for count -
    no aggregations, no pagination bounds etc.

All additional keyword arguments will be included into the dictionary.
def to_dict(self, count=False, **kwargs):
    "\n        Serialize the search into the dictionary that will be sent over as the\n        request's body.\n\n        :arg count: a flag to specify if we are interested in a body for count -\n            no aggregations, no pagination bounds etc.\n\n        All additional keyword arguments will be included into the dictionary.\n        "
    d = {}
    if self.query:
        d['query'] = self.query.to_dict()
    if (not count):
        if self.post_filter:
            d['post_filter'] = self.post_filter.to_dict()
        if self.aggs.aggs:
            d.update(self.aggs.to_dict())
        if self._sort:
            d['sort'] = self._sort
        d.update(self._extra)
        if (self._source not in (None, {})):
            d['_source'] = self._source
        if self._highlight:
            d['highlight'] = {'fields': self._highlight}
            d['highlight'].update(self._highlight_opts)
        if self._suggest:
            d['suggest'] = self._suggest
        if self._script_fields:
            d['script_fields'] = self._script_fields
    d.update(kwargs)
    return d