def to_dict(self):
    out = []
    for s in self._searches:
        meta = {}
        if s._index:
            meta['index'] = s._index
        meta.update(s._params)
        out.append(meta)
        out.append(s.to_dict())
    return out
def to_dict(self):
    out = []
    for s in self._searches:
        meta = {}
        if s._index:
            meta['index'] = s._index
        meta.update(s._params)
        out.append(meta)
        out.append(s.to_dict())
    return out